treat <- rbinom(500, 1, .3)
weights <- rchisq(500, df = 2)
W <- as.weightit(weights, treat = treat, estimand = "ATE")
summary(W)
# See ?weightit.fit for using as.weightit() with a
# weightit.fit object.
Run the code above in your browser using DataLab