Modern Balancing
Python · from scratch · R · WeightIt, CBPS, Matching, tmle · LaLonde NSW/CPS
Targeting Balance Directly
The matching page followed the classic two-step dance: estimate a propensity score, match or weight on it, then check balance — and if balance is poor, respecify and try again. It works, but balance is an afterthought of a model fitted for a different objective, namely predicting treatment. A more modern generation targets balance directly, and pairs it with estimators that are doubly robust and statistically efficient.
Entropy balancing (Hainmueller 2012) solves for control weights that make the reweighted covariate moments exactly equal the treated group’s while staying as close to uniform as possible — balance by construction, no iteration. CBPS (Imai & Ratkovic 2014) estimates the propensity score so that it simultaneously fits treatment and balances covariates. Genetic matching (Diamond & Sekhon 2013) searches for the distance-metric weights that optimize balance. TMLE — targeted maximum likelihood estimation (van der Laan & Rubin 2006) — adds a targeting step to a plug-in estimator, achieving double robustness and the semiparametric efficiency bound.
Entropy Balancing, and What Exact Balance Costs
Entropy balancing skips the propensity model entirely. It finds weights on the control units satisfying the balance constraints while maximizing entropy . The solution has the clean exponential form , with the multipliers found by a small convex dual. The payoff is real: balance is exact rather than approximate, and there is no fit-check-refit loop. Maximum imbalance collapses from 1.76 standardized units to 5 × 10−6.
The exactness has a price the balance table does not show. Maximum entropy keeps the weights as uniform as the constraints allow — and where the control pool genuinely does not resemble the treated group, that is not very uniform at all. The effective control sample falls to 98 of 429, a 77% loss.
| quantity | value | reading |
|---|---|---|
| max |SMD|, before → after | 1.762 → 5 × 10−6 | exact, by construction |
| effective control sample | 98 of 429 | a 77% loss |
| relative weight, median | 0.183 | the typical control counts for a fifth |
| relative weight, max | 9.42 | one control counts for nine |
| controls under a tenth of uniform weight | 120 of 429 | effectively discarded |
| weight held by the heaviest 25 | 38% | the estimate rests on a few dozen units |
The typical control ends up carrying under a fifth of uniform weight while a handful carry more than nine times it, and the heaviest 25 of 429 hold 38% of the total. Exact balance is not free; it is paid for in variance. That trade is invisible if you report the balance table alone — and on a dataset with poor overlap, which is precisely when exact balancing looks most attractive, it is exactly when the bill comes due.
TMLE and the Targeting Step
TMLE combines an outcome model and a propensity model like AIPW, then adds a targeting step that updates the outcome model in the direction that removes bias for the causal parameter rather than for prediction. Fit and , form the clever covariate , regress the residual on with no intercept to get , and update . It is doubly robust and attains the efficiency bound.
| stage | ATT |
|---|---|
| initial plug-in g-computation: predict both potential outcomes from the outcome model and average the difference | USD 1,548 |
| targeting fluctuation ε | −36.3 |
| TMLE, after targeting | USD 1,199 |
| experimental benchmark | USD 1,794 |
Those are asymptotic guarantees, and this is one finite sample. Worth noting which way targeting moved things: the plug-in sat at USD 1,548 and TMLE moved it to USD 1,199 — USD 350 further from the USD 1,794 benchmark rather than closer. That is not evidence against TMLE. An estimator with better asymptotic properties can land worse on any single dataset, and the benchmark is only visible here because someone ran the experiment. It is a reminder that efficiency is a claim about repeated sampling, not about this answer.
Every Method Against the Benchmark
| estimator | ATT | vs benchmark |
|---|---|---|
| naive (CPS controls) | −USD 635 | wrong sign |
| NN-propensity matching | USD 1,792 | essentially exact |
| IPW | USD 1,316 | −27% |
| entropy balancing | USD 1,273 | −29% |
| AIPW | USD 1,225 | −32% |
| TMLE | USD 1,199 | −33% |
Experimental benchmark USD 1,794. Mahalanobis matching, at USD 719, is on the matching page. AIPW reads USD 1,225 here against USD 1,226 there because this notebook reuses the clipped propensity score from the TMLE section.
Lined up against the estimators from the matching page, the modern methods cluster in the same band — and that band sits roughly 30% below the experimental truth, which the far simpler nearest-neighbour propensity match had hit almost exactly. Sophistication bought better balance and better asymptotics here, not a closer answer.
That is not an argument against the modern toolkit, and the ranking on this one dataset should not be read as a ranking of methods — LaLonde is famously hard, and a single comparison against a single benchmark is one draw. What it does show is that optimizing the diagnostic is not the same as improving the estimate. Taken with the previous page, where the better-balanced matching scheme also produced the worse number, a pattern emerges: balance is a necessary condition that behaves poorly as an objective.
And the caveat from the sensitivity page governs all of it. Every estimate here assumes unconfoundedness, and the LaLonde matched estimate proved fragile at . Better balancing tightens what can be seen; it cannot rule out what cannot be seen. No amount of optimization at the weighting stage addresses an omitted confounder.
Where this sits
Entropy balancing is the calibration-weighting cousin of survey weighting and of IPW; TMLE is the efficient sibling of the AIPW estimators, and both point forward to Double/Debiased ML, where the nuisance models become machine learners and cross-fitting replaces the plug-in. All of it presumes the back-door condition that the DAG material makes graphical, and all of it inherits the fragility the sensitivity analysis quantifies.
Notebooks
Downloads
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–46. — entropy balancing
- Imai, K. & Ratkovic, M. (2014). The Role of Prediction Modeling in Propensity Score Estimation: An Evaluation of Logistic Regression, bCART, and the Covariate-Balancing Propensity Score. American Journal of Epidemiology 180(6), 645–655. — the covariate balancing propensity score
- Zubizarreta, J. R. (2015). Stable Weights that Balance Covariates for Estimation With Incomplete Outcome Data. Journal of the American Statistical Association 110(511), 910–922. — stable balancing weights
- Athey, S., Imbens, G. W. & Wager, S. (2018). Approximate Residual Balancing: Debiased Inference of Average Treatment Effects in High Dimensions. Journal of the Royal Statistical Society Series B: Statistical Methodology 80(4), 597–623. — approximate residual balancing in high dimensions
- Rosenbaum, P. R. & Rubin, D. B. (1983). The central role of the propensity score in observational studies for causal effects. Biometrika 70(1), 41–55. — the propensity score these methods rebuild