
Entropy balancing weights (Hainmueller, 2012)
Source:R/matching.R
morie_matching_entropy_balance.RdNative entropy balancing (cross-validated against
WeightIt::weightit(method = "ebal") and ebal::ebalance):
weights for the control group so that the weighted moments of the
covariates match those of the treated group.
Usage
morie_matching_entropy_balance(
data,
treatment,
covariates,
max_moment = 1L,
max_iter = 500L,
tol = 1e-06
)Value
A numeric vector of weights aligned to the rows of data
after dropping NAs. Treated units receive weight 1.
References
Hainmueller, J. (2012). Entropy balancing for causal effects. Political Analysis, 20(1), 25–46.
Examples
if (requireNamespace("ebal", quietly = TRUE)) {
# \donttest{
set.seed(1)
df <- data.frame(y = rnorm(200), d = rbinom(200, 1, 0.4),
x1 = rnorm(200), x2 = rnorm(200))
w <- morie_matching_entropy_balance(df, "d", c("x1", "x2"))
# }
}