Skip to content

Add # of units discarded in bal.tab()$Observations when using subclassification with discard #59

Open
@sky0502

Description

@sky0502

Hi, I have a suggestion to add # of units discarded in bal.tab()$Observations when using subclassification with discard.
For example,

library(MatchIt)
library(cobalt)
data("lalonde")
m_out <- matchit(treat ~ age + educ + race + married + nodegree, 
                 data = lalonde, method = "subclass", distance = "glm", discard = "both")
m_summary <- bal.tab(m_out)
m_summary$Observations

Currently it returns

          1  2  3  4  5  6 All
Control 297 21 24 15  9 14 429
Treated  31 31 30 31 31 30 185
Total   328 52 54 46 40 44 614

Add a column of "discarded" so that the numbers add up to "All".

          1  2  3  4  5  6 Discarded All
Control 297 21 24 15  9 14       49  429
Treated  31 31 30 31 31 30        1  185
Total   328 52 54 46 40 44       50  614

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions