Learn R Programming

WeightIt (version 0.7.1)

method_ebal: Entropy Balancing

Description

This page explains the details of estimating weights using entropy balancing by setting method = "ebal" in the call to weightit or weightitMSM. This method can be used with binary and multinomial treatments.

In general, this method relies on estimating weights by minimizing the entropy of the weights subject to exact moment balancing constraints. This method relies on ebalance from the ebal package.

Binary Treatments

For binary treatments, this method estimates the weights using ebalance. The following estimands are allowed: ATE, ATT, and ATC. The weights are taken from the output of the ebalance fit object. When the ATE is requested, ebalance is run twice, once for each treatment group. When include.obj = TRUE, the returned object is the ebal fit (or a list of the two fits when the estimand is the ATE).

Multinomial Treatments

For multinomial treatments, this method estimates the weights using ebalance. The following estimands are allowed: ATE and ATT. The weights are taken from the output of the ebalance fit objects. When the ATE is requested, ebalance is run once for each treatment group. When the ATT is requested, ebalance is run once for each non-focal (i.e., control) group. When include.obj = TRUE, the returned object is the list of ebalance fits.

Continuous Treatments

Continuous treatments are not supported.

Longitudinal Treatments

For longitudinal treatments, the weights are the product of the weights estimated at each time point. This method is not guaranteed to yield exact balance at each time point. NOTE: the use of entropy balancing with longitudinal treatments has not been validated!

Sampling Weights

Sampling weights are supported through s.weights in all scenarios.

Missing Data

Missing data is not compatible with the entropy balancing algorithm, so a few extra things happen when NAs are present in the covariates. First, for each variable with missingness, a new missingness indicator variable is created which takes the value 1 if the original covariate is NA and 0 otherwise. The missingness indicators are added to the model formula as main effects. The missing values in the covariates are then replaced with 0s (this value is arbitrary and does not affect estimation). The weight estimation then proceeds with this new formula and set of covariates. The covariates output in the resulting weightit object will be the original covariates with the NAs.

Additional Arguments

All arguments to ebalance can be passed through weightit or weightitMSM and take on the defaults of those in ebalance.

For base.weights, a vector with length equal to the total number of units can be supplied, in contrast to ebalance(), which requires a vector wth length equal to the number of controls.

When standardize = TRUE in the call to weightit, ebalance.trim is run on the resulting ebalance fit objects. Doing so can reduce the variability of the weights while maintaining covariate balance.

References

Hainmueller, J. (2012). Entropy Balancing for Causal Effects: A Multivariate Reweighting Method to Produce Balanced Samples in Observational Studies. Political Analysis, 20(1), 25<U+2013>46. 10.1093/pan/mpr025

See Also

weightit, weightitMSM

Examples

Run this code
# NOT RUN {
library("cobalt")
data("lalonde", package = "cobalt")

#Balancing covariates between treatment groups (binary)
(W1 <- weightit(treat ~ age + educ + married +
                  nodegree + re74, data = lalonde,
                method = "ebal", estimand = "ATT"))
summary(W1)
bal.tab(W1)

#Balancing covariates with respect to race (multinomial)
(W2 <- weightit(race ~ age + educ + married +
                  nodegree + re74, data = lalonde,
                method = "ebal", estimand = "ATE",
                standardize = TRUE))
summary(W2)
bal.tab(W2)

# }

Run the code above in your browser using DataLab