Blog

What a stacked DiD buys you that two-way fixed effects doesn't

10 August 2026

For a long time, the default way to estimate a difference-in-differences model with more than two periods was a two-way fixed effects (TWFE) regression: unit fixed effects, time fixed effects, and a treatment indicator. It's a single line of code, and for decades nobody thought twice about it.

The problem shows up when treatment happens at different times for different units — a "staggered adoption" design. This is the norm in most real settings: a policy rolls out state by state, a disaster hits different regions in different years, a firm adopts a practice on its own schedule. Goodman-Bacon (2021) showed that in this setting, TWFE doesn't estimate a clean average treatment effect. Instead, it implicitly compares every pair of units at every pair of time periods, including comparisons where an already-treated unit acts as the control for a newly-treated one. If treatment effects change over time — which they almost always do — those comparisons can carry the wrong sign, and the overall estimate can be badly biased or even flip sign relative to the true effect.

The stacked DiD fix

Cengiz, Dube, Lindner, and Zipperer (2019) popularized a simple, intuitive alternative: the stacked DiD. Instead of running one regression on the full staggered panel, you:

  1. For each treatment "event" (e.g., each disaster date, each policy rollout), build a clean mini dataset containing only that treated cohort and a set of not-yet-treated or never-treated units as controls.
  2. Restrict each mini dataset to a symmetric window around the event.
  3. Stack all of these clean 2-group, 2-period comparisons into one dataset, with an event-specific identifier.
  4. Run a single regression on the stacked data, with fixed effects saturated by the event identifier.

Because each event's comparison only uses genuinely untreated units as controls, the contamination problem from Goodman-Bacon disappears by construction. You're no longer implicitly asking "already-treated" units to serve as a counterfactual for someone else.

Where this shows up in my own work

This is exactly the design I use in my working paper on analyst exposure to extreme weather: each disaster event defines its own cohort and clean comparison window, stacked across all events in the NOAA Storm Events data. It's a bit more bookkeeping than a single TWFE regression, but the payoff is a treatment effect estimate you can actually trust under staggered timing — which, for anything using real-world rollout data, is most of the time.

Practical note: the main cost is sample size — restricting to clean comparisons within each event window throws away some data relative to using the full panel. In practice this has never been the binding constraint in datasets large enough to have many independent events, like disaster or policy panels.

← Back to Blog