Dynamic Difference-in-Differences

Statistics
Introduced by
Callaway & Sant'Anna; Sun & Abraham
Year
2021
Type
Causal inference / quasi-experimental
Family
Quasi-experimental / causal inference

What does it do?

Dynamic Difference-in-Differences extends the classic DiD framework to settings where units adopt treatment at different times.

Rather than collapsing all variation into a single 2x2 comparison, it estimates group-time average treatment effects for each adoption cohort at each calendar period, then aggregates them into interpretable summaries of the causal effect over event time.

The intuition behind the method

In many policies, units adopt treatment in different years: some regions introduce a rule in one year, others in later years, and some never adopt it. A conventional two-way fixed-effects regression with a single treatment indicator pools all of these comparisons into one coefficient. When effects differ across cohorts or change over time, some of the pooled comparisons use already-treated units as controls, and these comparisons can contaminate the summary estimate. Dynamic DiD avoids this by estimating a separate effect for each adoption cohort at each period, using only comparisons with units that are not yet treated or never treated. Plotting these effects by event time shows how the treatment impact develops after adoption. The estimates are interpretable as causal effects only under a set of identifying assumptions: (1) parallel trends between each cohort and the chosen control group, conditional on covariates if these are used; (2) no anticipation, so outcomes do not respond before the adoption date (or an anticipation window is specified explicitly); (3) treatment is absorbing, so units do not switch back out once treated; and (4) no spillovers from treated to control units (SUTVA). Violations of (1) or (2) bias the ATT(g,t) estimates through contaminated baselines or counterfactuals; reversals break the cohort definition; spillovers make the control outcomes reflect treatment.

History

Dynamic DiD methods were developed in response to concerns that the standard two-way fixed-effects regression used in staggered designs can mix comparisons involving already-treated units. Callaway and Sant'Anna proposed an approach based on group-time ATTs, and Sun and Abraham proposed an interaction-weighted estimator based on cohort-by-relative-time interactions; both papers appeared in the same issue of the Journal of Econometrics (vol. 225, issue 2, 2021, available online in 2020). They are alternative estimators for the same problem.

When to use it

Use Dynamic DiD when treatment is adopted at different times across units (staggered rollout) and you suspect that treatment effects are heterogeneous across cohorts or change over event time. It is also appropriate when you want to formally test and visualise pre-trends, or when recovering event-time profiles matters more than a single average effect. It requires panel data with multiple pre- and post-treatment periods for at least some cohorts. Do not use it when all units are treated simultaneously (standard DiD suffices), when only one pre-treatment period exists per cohort (parallel trends are untestable), or when the panel is too short to trace dynamic paths meaningfully.

Limitations and considerations

  • Requires sufficient sample size within each adoption cohort; thin cohorts yield imprecise ATT(g,t) estimates that can dominate aggregated results.
  • Needs multiple pre-treatment periods per cohort to examine pre-trends; with a single pre-period the key assumption cannot be checked.
  • Conceptually and computationally more demanding than TWFE, requiring deliberate choices about the control group definition and aggregation weights.
  • Identification rests on parallel trends (conditional on covariates if used), no anticipation, absorbing treatment and no spillovers; unobserved time-varying confounders that differ across cohorts, anticipation effects or spillovers to controls can bias the estimates.
  • When no never-treated group exists and all units eventually adopt treatment, the not-yet-treated comparison group shrinks over time, increasing uncertainty in later event periods.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Avoids the contaminated weighted average produced by TWFE regression when treatment effects are heterogeneous across cohorts or event time.
  • Recovers event-time profiles showing whether effects build up, stabilise, or fade, information that a standard DiD with a single post-treatment comparison cannot provide.
  • Provides pre-treatment ATT(g,t) estimates that serve as a built-in diagnostic for parallel trends, rather than leaving that check as an afterthought.
  • Allows flexible aggregation into cohort-specific, calendar-time, or overall summaries matched to the research question.
  • Implemented in widely used, documented software packages such as the R did package and Stata csdid.

Applications

  • Evaluating staggered policy rollouts such as minimum-wage increases adopted in different years across U.S. states.
  • Measuring the dynamic earnings effects of job-training programmes that enrol successive cohorts over several years.
  • Assessing how health outcomes evolve over event time following staggered Medicaid or social-insurance expansions.
  • Studying firm-level responses to regulations that phase in across industries or regions at different dates.
  • Tracing the dynamic effects of cash-transfer or subsidy programmes on household consumption or investment over years post-adoption.
  • Revisiting older TWFE-based estimates in economics, public health, and political science to assess contamination bias.

How it works

How it works

1

Units are grouped into adoption cohorts g defined by the first period they receive treatment, with never-treated units forming a clean comparison group. This grouping is the foundation for constructing uncontaminated comparisons: later-adopting cohorts can serve as controls for earlier ones only before their own adoption date. The setup assumes treatment is absorbing: once a unit is treated it stays treated.

Formula
G_i = \text{first period unit } i \text{ receives treatment (}\infty\text{ if never treated)}
2

For each cohort g and calendar period t, ATT(g,t) is the average effect of treatment on that cohort's outcome in period t, relative to the outcome the cohort would have had if it had never been treated. It is identified by comparing the change in the cohort's outcome between a pre-treatment base period, typically the period just before adoption, and period t with the same change for control units that are never treated or not yet treated by period t. Already-treated units are excluded from the controls, which avoids the contamination present in naive TWFE event-study regressions. This page's mechanics and software notes follow the Callaway and Sant'Anna estimator; the Sun and Abraham interaction-weighted estimator is an alternative (see History).

Formula
ATT(g,t) = E[Y_t(g) - Y_t(\infty) \mid G_i = g]
3

The many ATT(g,t) estimates are aggregated into summary parameters using researcher-chosen weights: a single overall ATT, an event-time profile showing effects at each horizon relative to adoption, or group-specific averages. The aggregation scheme should be chosen to match the research question rather than set arbitrarily.

Formula
\theta = \sum_{g,t} w_{g,t}\, ATT(g,t)
4

Pre-treatment ATT(g,t) estimates, for periods before cohort g adopts, should be close to zero. Plotting them with confidence intervals alongside post-treatment estimates provides a diagnostic check on the parallel-trends assumption. Systematic non-zero pre-trends suggest that the comparison group may not be a valid counterfactual and that the design should be reconsidered. Pre-trend tests have low power against economically meaningful violations, so a non-significant result is weak evidence: report the pre-period estimates with their intervals and consider how large a violation the design could detect. A pre-trend check cannot by itself confirm the assumption for the post-treatment period.

Formula
ATT(g,t) \approx 0 \quad \text{for } t < g
5

The final output is typically an event-study plot: estimated effects plotted against event time (periods since treatment adoption) with confidence bands. Flat pre-trends and a clear break at event time zero are consistent with a valid design. Non-zero estimates just before event time zero may indicate anticipation of treatment, while gradually changing post-treatment effects may reflect dynamic accumulation of the treatment impact.

Formula
\theta(e) = \sum_{g} w_g\, ATT(g,g+e)

Common pitfalls

  • Running a standard TWFE event-study regression with staggered timing and reading its coefficients as cohort-clean effects. When effects vary across cohorts or over time, these coefficients can mix clean and contaminated comparisons and need not represent the average treatment effect on the treated.
  • Choosing never-treated units as the control group when their trends differ systematically from those of treated cohorts; in such cases not-yet-treated units may give a more credible comparison.
  • Ignoring thin cohorts and reporting aggregated averages that are driven by a single large cohort, masking substantive heterogeneity.
  • Over-interpreting a visually flat pre-trend as proof of parallel trends rather than as supporting but not conclusive evidence.
  • Failing to cluster standard errors at the unit level, which understates uncertainty arising from serial correlation within units across periods.

Frequently asked questions

How is Dynamic DiD different from a standard event-study regression?

A standard event-study adds leads and lags of a treatment dummy to a TWFE regression but can still use already-treated units as controls for later-adopting cohorts. When effects are heterogeneous, this can bias some of the coefficients. Dynamic DiD restricts each cohort-time comparison to clean control groups, never-treated or not-yet-treated units, which avoids that contamination.

Do I need a never-treated group?

Not necessarily. Callaway and Sant'Anna allow the control group to be either never-treated units or not-yet-treated units. If every unit eventually adopts treatment, the not-yet-treated comparison is used, though this pool shrinks over time and can raise concerns if late adopters differ systematically from early ones.

How do I choose aggregation weights?

The choice should follow the research question. For an overall summary ATT, weights can reflect cohort size and post-treatment exposure. For event-time dynamics, ATT(g,t) estimates are averaged over cohorts at each horizon. For group-specific effects, cohort-level averages are reported. Consult the documentation of the software you use, such as the R did package or Stata csdid, for the aggregation options it provides.

What happens if treatment effects are homogeneous across cohorts?

If effects are constant across cohorts and event time, TWFE is consistent for the common effect, so the contamination concern does not arise. Dynamic DiD is still useful for testing pre-trends and estimating event-time profiles, and it does not change the identifying assumptions.

Can Dynamic DiD be used with a binary outcome?

ATT(g,t) is defined on the scale of the outcome, so for a binary outcome it is a difference in probabilities. Confirm how your software handles binary outcomes before interpreting the estimates.

Related methods

Sources

  1. Callaway, B., & Sant'Anna, P. H. C. (2021). Difference-in-differences with multiple time periods. Journal of Econometrics, 225(2), 200-230.

    Open DOI reference
  2. Sun, L., & Abraham, S. (2021). Estimating dynamic treatment effects in event studies with heterogeneous treatment effects. Journal of Econometrics, 225(2), 175-199.

    Open DOI reference