- Introduced by
- Hainmueller (2012); extended to panel settings by subsequent applied econometric work
- Year
- 2012 (cross-section); panel adaptation mid-2010s onward
- Type
- Covariate balancing / reweighting estimator
- Family
- Quasi-experimental / causal inference
What does it do?
Panel data entropy balancing adapts Hainmueller's (2012) entropy balancing method to longitudinal data with a binary treatment.
It assigns weights to control units so that their weighted pre-treatment covariate moments match those of the treated group, and the weights are then typically used in a weighted panel regression to estimate the treatment effect. Unlike propensity-score weighting, it does not require a propensity model to be specified and fitted first. Applications of the panel version differ in how the balance conditions and the outcome model are set up, so these choices should be stated explicitly.
The intuition behind the method
Propensity-score models can leave covariate imbalance when they are misspecified, and iterating over model specifications to improve balance is laborious. Entropy balancing takes a different route: it solves directly for control-unit weights that stay as close as possible to uniform weights while satisfying exact balance conditions on chosen covariate moments such as means and variances. In a panel setting the same conditions can be imposed across the pre-treatment periods, so the weighted control group is aligned with the treated group over time, not only at one baseline. This alignment is what makes the weighted comparison over time easier to interpret, although it does not by itself establish parallel trends.
History
Hainmueller introduced entropy balancing in a 2012 Political Analysis paper as a reweighting alternative to propensity-score approaches that imposes exact balance on prespecified covariate moments. Zhao (2019) proposed covariate balancing scoring rules for estimating propensity scores so that balance is improved in inverse probability weighting. The panel adaptation of entropy balancing appears in later empirical work and is implemented in varying ways across applications.
When to use it
Use panel data entropy balancing when you have longitudinal data with a binary treatment, a set of pre-treatment covariates, and a concern that treated and control units differ on observed characteristics. It suits designs where you want exact balance on specified moments without fitting a propensity model, and where the pre-treatment window contains more than one period so that balance can be checked before treatment. It is less suitable when the pre-treatment window is very short, when overlap between treated and control units is poor, or when the treatment is continuous, since the standard method targets binary treatments. Treat the estimates as causal only after checking post-weighting balance and whether the parallel-trends assumption is plausible. For inference, cluster standard errors by unit, since outcomes are serially correlated within units. Because the weights are estimated from the data, standard errors that treat them as fixed can be too small; a bootstrap that re-estimates the weights in each replication is one way to reflect this.
Limitations and considerations
- Balance conditions can be infeasible when treated and control covariate distributions do not overlap, and the optimiser then fails to converge.
- Exact balance on the specified moments does not guarantee balance on unspecified higher moments or on time-varying unobserved confounders.
- In very short panels the pre-treatment window may be too narrow to impose meaningful multi-period balance conditions.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Imposes exact balance on the covariate moments specified in the constraints, so balance on those moments is achieved by construction rather than checked after a model is fitted.
- Does not require a propensity model, so the balance result does not depend on getting a first-stage model right.
- The entropy objective keeps weights closer to uniform than many alternatives, although extreme weights can still arise when overlap is poor.
- The optimisation is convex, so when the balance conditions are feasible the solution is unique.
- Can be combined with weighted panel regression, so that unit and time fixed effects can absorb time-invariant heterogeneity after the reweighting.
Applications
- Estimating the effect of a policy adopted by some regions but not others, using panel records where the pre-treatment covariates are balanced across periods before the weighted comparison.
- Assessing a firm-level governance or organisational change when treated and control firms differ on size and sector, with balance conditions imposed on those covariates.
- Evaluating a programme in a longitudinal cohort where treated and untreated participants differ on baseline characteristics, with balance checked across pre-treatment waves.
- Running a reweighted comparison as a robustness check next to a difference-in-differences design when the covariates suggest the untreated group may not follow the same path before treatment.
How it works
How it works
Define the panel: units i observed over time t, a binary treatment indicator, an outcome variable, and covariates measured before treatment whose moments will be balanced. Let T0 denote the set of pre-treatment periods used for balancing. Identify treated and control units and choose which moments to target, typically means and variances, with higher moments possible. State explicitly which periods the balance conditions refer to and which periods enter the outcome analysis.
Write one balance condition for each targeted covariate and moment, requiring that the weighted control moment equals the corresponding treated-group moment. In the panel version these conditions are imposed for each covariate k and each pre-treatment period t in T0, so that covariates are aligned over time rather than only at a single baseline. Covariates must be measured before treatment, so that post-treatment variables, which may be affected by treatment, are not balanced.
Formula
\sum_{i \in \mathcal{C}} w_i \, X_{it}^{k} = \bar{X}_{\mathcal{T},t}^{k} \quad \forall k,\; t \in T_0Solve the convex problem given in the optimisation formula: minimise the divergence of the control weights from base weights q_i, subject to the balance conditions, non-negativity, and weights that sum to one. With uniform base weights q_i = 1/N_C, the objective sum w_i ln(w_i/q_i) equals sum w_i ln(w_i) plus a constant, so both forms have the same minimiser. The objective keeps the reweighting as small as the balance conditions allow. Where the constraints cannot be met, the problem has no solution and the optimiser will fail to converge.
Formula
\min_{w} \sum_{i \in \mathcal{C}} w_i \ln\!\left(\frac{w_i}{q_i}\right) \quad \text{s.t. balance constraints and } \textstyle\sum w_i = 1,\; w_i \ge 0Apply the optimal weights to the control units. In the simplest case, compare the treated mean outcome with the weighted control mean, as in the estimator formula. In a panel setting the comparison is commonly run inside a weighted regression, for example Y_it = alpha_i + lambda_t + tau D_it + e_it, estimated with the entropy-balancing weights (treated units receiving a weight of one or the corresponding base weight), where D_it is the treatment indicator. State which periods the estimation window includes.
Formula
\hat{\tau} = \bar{Y}_{\mathcal{T}} - \sum_{i \in \mathcal{C}} w_i^{*} Y_iOptionally add unit and time fixed effects to the weighted regression to absorb time-invariant unit heterogeneity and common period shocks. The fixed effects add a regression adjustment on top of the weighting. Whether this combination has the protective properties associated with doubly robust estimators should be checked for the specific design rather than assumed.
Common pitfalls
- Balancing only covariate means and ignoring variances or higher moments, which leaves imbalance that the method was able to remove and that can bias the estimate.
- Applying the method without checking overlap between treated and control units; thin common support produces extreme weights and inflated variance.
- Interpreting the weighted estimate as causal without checking whether the parallel-trends assumption is plausible in the pre-treatment periods after weighting.
- Treating cross-sectional entropy balancing on pooled data as a panel estimate. A panel version needs period-specific or pooled balance conditions carried into a weighted panel regression.
- Omitting the effective sample size implied by the weights. It is computed as (sum w)^2 / sum w^2; values far below the number of control units indicate that a few units dominate the comparison and that precision is substantially reduced. Report it alongside the estimate.
- Ignoring weight estimation and within-unit correlation in inference: use unit-clustered standard errors and consider a bootstrap that re-estimates the weights.
Frequently asked questions
How does entropy balancing differ from propensity score matching in a panel setting?
Propensity score matching models the probability of treatment and uses that model to select or reweight control units, so residual imbalance can remain if the model is misspecified. Entropy balancing does not fit a propensity model. It solves directly for weights that satisfy the balance conditions on the specified moments.
Can I combine entropy balancing with panel fixed effects?
Yes. After computing the entropy-balanced weights, they can be used in a weighted panel regression with unit and time fixed effects. The robustness properties of this combination should be checked for the design, since the sources used here do not establish them.
What should I do if the optimisation does not converge?
Non-convergence usually signals that the balance conditions cannot be met, which often reflects limited overlap between treated and control units. Possible responses are to restrict the sample to units with comparable covariates, to reduce the number of balance conditions, or to target fewer covariate moments.
How many pre-treatment periods do I need?
More than one pre-treatment period is advisable: one period can be used to impose balance conditions, and another to check whether the reweighted control group tracks the treated group before treatment. The exact number depends on the design and is not fixed by the method.
Does entropy balancing handle unobserved confounders?
Only partially. Entropy balancing controls for the observed covariates whose moments are specified. Panel fixed effects remove time-invariant unobserved heterogeneity, but time-varying unobserved confounders remain a threat and require additional identification assumptions or sensitivity analysis.
Related methods
Sources
Hainmueller, J. (2012). Entropy Balancing for Causal Effects: A Multivariate Reweighting Method to Produce Balanced Samples in Observational Studies. Political Analysis, 20(1), 25-46.
Open DOI referenceZhao, Q. (2019). Covariate balancing propensity score by tailored loss functions. Annals of Statistics, 47(2), 965-993.
Open DOI reference