# NOT RUN {
library(mice)
library(MatchThem)
data("lalonde_mis", package = "cobalt")
#Imputing the missing data
imp <- mice(lalonde_mis, m = 5)
#Matching using within-imputation propensity scores
mt.out1 <- matchthem(treat ~ age + educ + race +
married + nodegree + re74 + re75,
data = imp, approach = "within")
bal.tab(mt.out1)
#Matching using across-imputation average propensity scores
mt.out2 <- matchthem(treat ~ age + educ + race +
married + nodegree + re74 + re75,
data = imp, approach = "across")
bal.tab(mt.out2)
#Weighting using within-imputation propensity scores
wt.out <- weightthem(treat ~ age + educ + race +
married + nodegree + re74 + re75,
data = imp, approach = "within",
estimand = "ATT")
bal.tab(wt.out)
# }
Run the code above in your browser using DataLab