Skip to contents

Thin wrapper around WeightIt::weightit(method = "ebal") (or ebal::ebalance if WeightIt is unavailable). Computes 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
)

Arguments

data

Data frame.

treatment

Binary treatment column name.

covariates

Character vector of covariates.

max_moment

Highest moment to balance (1 = means, 2 = means + var, 3 = + skewness).

max_iter

Maximum Newton iterations (forwarded to ebal).

tol

Convergence tolerance (forwarded to ebal).

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 (FALSE) { # \dontrun{
w <- morie_matching_entropy_balance(df, "d", c("x1", "x2"))
} # }