if (FALSE) { # requireNamespace("sbw", quietly = TRUE)
library(sbw); data("lalonde", package = "cobalt")
## Stable balancing weights for the ATT
sbw.out <- sbw(splitfactor(lalonde, drop.first = "if2"),
ind = "treat",
bal = list(bal_cov = c("age", "educ", "race_black",
"race_hispan", "race_white",
"married", "nodegree",
"re74", "re75"),
bal_alg = FALSE,
bal_tol = .001),
par = list(par_est = "att"))
bal.tab(sbw.out, un = TRUE, poly = 2)
}
Run the code above in your browser using DataLab