Skip to contents

Reweights controls so their covariate moments match the treated group EXACTLY, subject to staying as close to uniform as possible.

Usage

morie_entropy_balancing(X, treat, moments = 1, max_iter = 200L, tol = 1e-08)

Arguments

X

covariate matrix.

treat

0/1 treatment indicator.

moments

1 for means, 2 for means and variances.

max_iter, tol

Newton controls.

Value

list with weights (on the controls, summing to 1), lambda, max_imbalance, ess, converged.

Details

The difference from propensity weighting is where the modelling happens. IPTW models the assignment mechanism and hopes the resulting weights balance; entropy balancing imposes balance as a constraint and solves for the weights. Balance is then exact on the moments specified and says nothing whatever about the ones that were not, nor about unmeasured confounders.

Non-convergence is itself the finding: it means no reweighting of the controls can reach the treated moments, which is a positivity problem, not a numerical one.

References

Hainmueller, J. (2012). Entropy balancing for causal effects. Political Analysis, 20(1), 25-46.

Examples

set.seed(1)
X <- matrix(rnorm(300), ncol = 2)
tr <- rbinom(150, 1, 0.4)
morie_entropy_balancing(X, tr)$max_imbalance < 1e-6
#> [1] TRUE