- Introduced by
- Chernozhukov, Wuthrich & Zhu; Freyaldenhoven, Hansen & Shapiro (parallel developments)
- Year
- 2019-2021
- Type
- Causal inference / quasi-experimental
- Family
- Quasi-experimental / causal inference
What does it do?
The machine learning-augmented panel event study extends the classical panel event study by replacing or supplementing its parametric counterfactual with a machine learning estimator, such as LASSO, elastic net, random forests or matrix completion.
The aim is a better-fitting pre-event baseline, a check on parallel trends, and dynamic effect estimates across several post-event periods.
The intuition behind the method
A standard event study asks how outcomes for treated units changed relative to what would have happened without the event. The classical approach relies on a simple, usually linear, counterfactual built from a few controls, which can be misspecified when many donor units or covariates are available and their relationships are nonlinear. ML augmentation lets the counterfactual draw on many donors and covariates at once. The pre-event fit is the main diagnostic: if the model tracks treated units closely before the event, its post-event prediction is a more credible baseline. A good pre-event fit is necessary but not sufficient, because a flexible model can fit the pre-period without predicting the counterfactual well.
History
Panel event studies are a long-established design for estimating dynamic effects of discrete events, and their identifying assumptions have been examined in the economics literature. Freyaldenhoven, Hansen and Shapiro (2019) analyse a linear panel event-study design estimated by two-stage least squares, in which covariates related to the policy only through confounds allow identification even when pre-event trends appear. Chernozhukov, Wuthrich and Zhu (2021) introduce permutation-based conformal inference for counterfactual and synthetic control methods that can be used with high-dimensional predictors, including factor and matrix completion models. The combined approach, an ML-based counterfactual paired with event-study estimation and permutation or conformal inference, draws on both lines of work. The two papers cited here develop its components rather than the combined estimator itself.
When to use it
Use this method when you have a panel with a discrete event affecting some units, several pre- and post-event periods, and either many potential control units or high-dimensional covariates, so that a small parametric regression is unlikely to build a credible counterfactual. It is a reasonable choice when you doubt that a standard difference-in-differences or event-study parallel-trends assumption holds and want a data-driven way to select and weight donors. Avoid it when the pre-event window is short (fewer than 10 periods), when there are no clean control units, when outcomes are purely cross-sectional, or when the audience needs simple, transparent regressions rather than ML-based components.
Limitations and considerations
- Requires a sufficiently long pre-event window to train and check the ML model; with fewer than about 10 pre-event periods the counterfactual is poorly identified.
- The ML component makes the estimation pipeline harder to audit, replicate and explain to non-technical readers than a standard event-study regression.
- Tuning choices such as the LASSO penalty or tree depth can change the estimates, so they must be selected within the pre-event window and their sensitivity reported.
- Permutation and conformal inference have low power when the number of treated units is very small.
- Spillover effects on donor units violate the stable unit treatment value assumption and contaminate the counterfactual.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Lets the counterfactual draw on many donor units and covariates at once, which a regression with a few hand-picked controls cannot do without ad hoc variable selection.
- Pre-event residuals give a direct check on the counterfactual: systematic non-zero residuals before t0 signal misfit or pre-existing divergence, although they do not by themselves rule out confounds.
- Can be paired with conformal or permutation inference, whose permutation-based validity Chernozhukov, Wuthrich and Zhu (2021) argue holds under weak, easy-to-verify conditions, reducing reliance on large-sample approximations.
- Extends to heterogeneous effects across event-time lags within one framework, so the shape of the effect path can be inspected directly.
Applications
- Estimating stock-market reactions to firm-level events, such as earnings announcements or mergers, using many comparable firms as donors.
- Assessing labour-market effects of plant closures by constructing comparison groups for affected workers from a large pool of donor units.
- Evaluating public-health interventions, such as vaccination campaigns or lockdown orders, against a donor pool of untreated regions.
- Measuring dynamic revenue effects of a tax reform applied to some industries but not others, with many covariates selected by LASSO.
- Studying environmental or policy shocks on local outcomes when high-dimensional geographic controls are available.
How it works
How it works
Identify the event date, the treated unit or units, and a pool of control units plausibly unaffected by the event. Assemble a balanced or unbalanced panel with enough pre-event periods to train and check the ML model and enough post-event periods to trace the dynamic effect. Donors that may be exposed to the event or its spillovers should be screened out before estimation. The estimand is the average effect on the treated units at each event-time lag l, that is, the difference between each treated unit's observed outcome and the outcome it would have had without the event, averaged over treated units. Estimation relies on four assumptions: no anticipation (outcomes do not respond before the event date), no spillovers from the event to donor units (the stable unit treatment value assumption), donors that are unaffected by the event, and a stable relationship between donor outcomes, covariates and the treated units' counterfactual outcome from the pre-event period into the post-event period. These assumptions cannot be tested in full; the pre-event checks described below address only part of them.
Train a machine learning model, such as LASSO, elastic net, a random forest or matrix completion, on the pre-event data for donor units and covariates to predict what each treated unit's outcome would have been without the event. The fitted function can capture nonlinear structure and, for penalised estimators such as LASSO, select a subset of informative donors. All tuning must use pre-event data only. A practical procedure is to split the pre-event window in time order, using rolling-origin or blocked validation rather than random splits, which would mix future and past periods. Tune the penalty or tree depth on the validation blocks, then refit on the full pre-event window. Report the out-of-sample pre-event error for each estimator, along with placebo effect sizes obtained by assigning the event to earlier pre-event dates. Whether a fit is adequate is a judgement that should be reported openly rather than settled by a fixed cut-off. Compare at least two estimators, since agreement between them is more informative than a single good fit.
Formula
\hat{y}_{it}^{(0)} = \hat{f}_{\text{ML}}(X_{it},\, \{y_{j,t}\}_{j \notin \mathcal{T}})After the event date t0, the estimated effect for treated unit i at each post-event lag l is the observed outcome minus the ML counterfactual prediction. Residuals before t0 serve as a pre-trend check. Systematic non-zero pre-event residuals indicate that the counterfactual model is misspecified or that the treated units were already diverging from the donors. They can also reflect unobserved confounds that affect both the outcome and the event, and such confounds can bias the estimate even when pre-event residuals look small. A flat pre-event path is reassuring but is not by itself proof of identification. In their linear two-stage least squares framework, Freyaldenhoven, Hansen and Shapiro (2019) show that a causal effect can still be identified when pre-event trends are present, provided suitable covariates are related to the event only through those confounds. The pre-trend check should therefore inform the judgement about identification rather than settle it.
Formula
\hat{\tau}_{it} = y_{it} - \hat{y}_{it}^{(0)}, \quad t \geq t_0Average the unit-level effects across treated units at each event-time lag l to obtain the average dynamic effect path. Plotting these averages against event time gives the familiar event-study graph, showing when effects appear, how they evolve, and whether they fade.
Formula
\hat{\tau}(l) = \frac{1}{|\mathcal{T}|} \sum_{i \in \mathcal{T}} \hat{\tau}_{i,t_0+l}Construct intervals and p-values with permutation or conformal procedures. Chernozhukov, Wuthrich and Zhu (2021) describe permutation inference of this kind as valid under weak, easy-to-verify conditions and robust to misspecification of the counterfactual model. In a permutation test, the treatment assignment or event timing is reassigned across donor units or placebo dates, the same test statistic (for example, the post-event average effect) is recomputed for each placebo assignment, and the p-value is the share of placebo statistics at least as large in magnitude as the statistic for the actual treated unit. These procedures do not depend on the large-sample normal approximations used by standard regression-based event studies, but their power can be low when the number of treated units is very small.
Common pitfalls
- Using post-event data to tune the ML model leaks information about the treatment effect into the counterfactual and invalidates the estimate; all model selection must occur within the pre-event window.
- Treating a good in-sample pre-event fit as sufficient. Flexible models can overfit the pre-period, so out-of-sample checks within the pre-event window are needed before trusting the post-event prediction.
- Relying on one ML algorithm without comparison. If the effect path changes substantially across reasonable estimators, the findings are fragile.
- Reading the event-study graph causally when earlier shocks or anticipation effects contaminate the pre-period. Identification requires ruling these out.
- Drawing conclusions about a stable long-run effect from an average across lags without first examining how the effect path varies across lags.
Frequently asked questions
How is this different from a standard panel event study?
A standard panel event study typically uses a parametric, often linear, counterfactual built from a small set of controls. The ML-augmented version replaces or supplements this with a flexible, data-driven estimator that can use many donors and nonlinear relationships. This can give a better-fitting counterfactual, but the gain must be checked against the pre-event fit and sensitivity to tuning.
Which ML estimator should I choose?
LASSO and elastic net are common starting points because they select donors automatically and are relatively well understood. Random forests and matrix completion may suit nonlinear or factor-type structure. Compare two or three estimators; if the effect path is similar across them, the conclusion is less dependent on one modelling choice.
How long does the pre-event window need to be?
A practical minimum is about 10 pre-event periods. With fewer, the ML model is poorly identified and the pre-trend check is uninformative. This is a rule of thumb rather than a formal requirement. The adequate length also depends on how many donors and covariates are used relative to the number of pre-event periods, and longer windows allow more reliable out-of-sample validation.
Can I use this when I have only one treated unit?
The method can be used with few treated units, and permutation-based inference assigns the treatment to donor units as placebos to build a reference distribution. However, power is limited when the number of treated units is very small, so the resulting p-values may be imprecise. Check the placebo distribution before interpreting the result.
What if donor units are also partially affected by the event?
Donors affected by the event contaminate the counterfactual, because the predicted outcome then includes part of the effect. If spillovers to donors have the same sign as the treatment effect, the estimated effect is biased toward zero; if they have the opposite sign, the estimated effect is biased away from zero. Screen donors carefully, exclude units plausibly exposed to the event or its spillovers, and run sensitivity analyses that drop borderline donors.
Related methods
Sources
Chernozhukov, V., Wuthrich, K., & Zhu, Y. (2021). An Exact and Robust Conformal Inference Method for Counterfactual and Synthetic Controls. Journal of the American Statistical Association, 116(536), 1849-1864.
Open DOI referenceFreyaldenhoven, S., Hansen, C., & Shapiro, J. M. (2019). Pre-event Trends in the Panel Event-Study Design. American Economic Review, 109(9), 3307-3338.
Open DOI reference