if (FALSE) { # all(sapply(c("WeightIt", "MatchIt"), requireNamespace, quietly = TRUE))
data("lalonde", package = "cobalt")
m.out <- MatchIt::matchit(treat ~ age + educ + race,
data = lalonde,
estimand = "ATT")
w.out <- WeightIt::weightit(treat ~ age + educ + race,
data = lalonde,
estimand = "ATT")
bal.tab(treat ~ age + educ + race, data = lalonde,
weights = data.frame(matched = get.w(m.out),
weighted = get.w(w.out)),
method = c("matching", "weighting"),
estimand = "ATT")
}
Run the code above in your browser using DataLab