Description Usage Arguments Value References See Also Examples

View source: R/standardized_mean_difference.R

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".

1 | ```
compute_smd(mi_obj = NULL, sd = "pooled")
``` |

`mi_obj` |
A matchit object derived from MatchIt pacakge |

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

Return a data frame containing SMD and other information

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

compute_sub_smd()

1 2 3 4 5 6 7 | ```
# 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")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.