Skip to content

Instantly share code, notes, and snippets.

@jepusto
jepusto / ebal-IPW-WLS.R
Created November 26, 2024 15:54
An example of inverse propensity weighting and weighted least squares regression adjustment for estimating an average treatment effect among treated units, using the entropy-balancing propensity score
library(cobalt)
library(WeightIt)
library(marginaleffects)
data("lalonde")
lalonde_trt <- subset(lalonde, treat == 1)
# ATT weighting with entropy-balancing
w_ebal <- weightit(