Learn R Programming

MatchItEXT

MatchItEXT is a supplementary pacakge to MatchIt in R. Its functions generate diagnostics that are unavailable in MatchIt and help assess the matching result (e.g., propensity score matching).

Installation

You can install the released version of MatchItEXT from CRAN with:

install.packages("MatchItEXT")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("zoudj/MatchItEXT")

Example

The code chunk below demonstrates the basic usage of MatchItEXT functions. For more details, please see the vignette.

library(MatchItEXT)
## Computing Standardized Mean Difference (SMD).
## m_near is the Nearest Matching result from matchit() in MatchIt package.
smd_near <- compute_smd(mi_obj = m_near, sd = "pooled")
smd_near

## Computing Standardized Mean Difference (SMD) of subclassification result.
## m_sub is the subclassification result from matchit() in MatchIt package.
smd_sub <- compute_sub_smd(mi_obj = m_sub, sd = "pooled")
smd_sub

## Drawing SMD comparison dot-and-line plot.
plot_smd_near <- plot_smd(smd_near)
plot_smd_near$plot

## Drawing QQ plot for group comparison on the distance measure.
m_near_qq <- plot_ps_qq(m_near)
m_near_qq$plot

## Computing variance ratio and residual variance ratio
m_near_var_ratio <- compute_var_ratio(m_near)
m_near_var_ratio

compute_res_var_ratio(original_data = lalonde, mi_obj = m_near, type_vec = 
                        c(0, 1, 1, 1, 2, 2), discard = FALSE)

Copy Link

Version

Install

install.packages('MatchItEXT')

Monthly Downloads

1

Version

0.0.1

License

GPL (>= 2)

Maintainer

Danjie Zou

Last Published

October 28th, 2020

Functions in MatchItEXT (0.0.1)

compute_smd

Compute standardized mean differences before and after matching
compute_res_var_ratio

Compute ratio of variances of residuals for covariates
compute_sub_smd

Compute standardized mean differences for subclassification result
parse_formula

Parse formula to obtain grouping variable and covariate vector
plot_smd

Draw a dot-line plot that compares the SMD change before and after matching
plot_ps_qq

Draw QQ plots of propensity score between groups before and after matching
compute_var_ratio

Compute the ratio of the variances of propensity score in the two groups