Learn R Programming

MatchItEXT (version 0.0.1)

compute_smd: Compute standardized mean differences before and after matching

Description

This function accepts a MatchIt object (i.e., the result of matchit function) , and calculates standardized mean differences before and after matching. Note exact matching and subclassification are not applicable to this function . For subclassification, use compute_sub_smd() instead. In addition, SMD can be calculated on the basis of the standard deviation of original treatment group, which is the formula used in matchit function, or on the basis of the simple pooled standard deviation of original treatment and control group. The default is sd = "pooled", but it can be switched to "treatment".

Usage

compute_smd(mi_obj = NULL, sd = "pooled")

Arguments

mi_obj

A matchit object derived from MatchIt pacakge

sd

The standard deviation used as the denominator in the formula, either "pooled" or "treatment"

Value

Return a data frame containing SMD and other information

References

Austin, P. C. (2011). An Introduction to Propensity Score Methods for Reducing the Effects of Confounding in Observational Studies. Multivariate Behavioral Research, 46(3), 399-424. https://doi.org/10.1080/00273171.2011.568786

Ho, D. E., Imai, K., King, G., & Stuart, E. A. (2011). MatchIt: Nonparametric Preprocessing for Parametric Causal Inference. Journal of Statistical Software, 42(8). https://doi.org/10.18637/jss.v042.i08

See Also

compute_sub_smd()

Examples

Run this code
# NOT RUN {
# take lalonde data as an example
# run matchit() to obtain the matching result (i.e., a matchit object)
 m_out <- MatchIt::matchit(treat ~ re74 + re75 + age + educ + hispan +
 black, data = MatchIt::lalonde, method = "nearest")
# use matching result and compute_smd() to obtain a SMD data
# frame
 opt_smd <- compute_smd(m_out, sd = "treatment")

# }

Run the code above in your browser using DataLab