Topic: Staggered treatment timing, two-way fixed effects (TWFE), and modern robust estimators Reference Data:mpdta (Callaway–Sant’Anna 2021; also used in Goodman-Bacon 2021 and Sun–Abraham 2021) Date: July 2026
In staggered adoption, units become treated at different calendar times \(g \in \{2, \dots, T\}\). A unit \(i\) in cohort \(G_i = g\) is treated in all periods \(t \geq g\) and untreated in \(t < g\). The estimand of interest is the ATT, potentially varying by cohort\(g\) and by event time\(k = t - g\).
where \(D_{it} = \mathbf{1}(t \geq G_i)\). Goodman-Bacon (2021) showed that the TWFE coefficient is a weighted average of all possible 2×2 DiD estimators comparing pairs of cohorts \((g, g')\). The “timing-of-treatment” comparisons — where an early-treated cohort is used as a control for a later-treated cohort before the later cohort’s own treatment — receive negative weight and are contaminated.
Three core failures: 1. Forbidden comparisons — already-treated units serve as controls for later-treated units. 2. Negative weights — even when every underlying ATT is positive and constant, \(\hat{\beta}_{TWFE}\) can be negative. 3. Heterogeneity bias — if effects differ by cohort \(g\) or event time \(k = t-g\), the contamination is signed and biases \(\beta\) in an unspecified direction.
TWFE remains consistent under homogeneous effects (\(\tau_{gt} = \tau\) for all \(g,t\)), because every 2×2 — forbidden or not — equals \(\tau\). The problem is entirely about effect heterogeneity interacting with timing.
3. Wooldridge’s Framework
Jeffrey Wooldridge clarifies what TWFE estimates via the unconditional group-time representation:
For a balanced panel this is numerically identical to conditional TWFE, but it reveals the coefficient as a weighted average of group-time average treatment effects (GTATs) \(\tau_{gt}\), with weights given by cohort-size shares times pre/post period shares.
Interaction-Weighted (IW) estimator: estimate each \(\tau_{gt}\) using only clean controls (never-treated or not-yet-treated), then aggregate with economically meaningful weights:
where \(N_g\) is the cohort size and \(\pi_{gt}\) is the post-treatment period weight. The IW weights are \(N_g \times (\text{share of post periods for cohort }g)\), so larger cohorts and longer post-treatment windows dominate — the policy-relevant weighting — and forbidden comparisons are excluded by construction. Recent work extends this to efficient GMM and clean event studies with \(k = -1\) as the reference period.
4. Estimator Comparison
Estimator
Core Strategy
Uses Forbidden Comparisons?
Robust to Hetero. Effects?
Naive TWFE
\(\alpha_i + \lambda_t + \beta D_{it}\)
Yes
No
Callaway–Sant’Anna (2021)
Cohort-time ATT \(\to\) aggregate
No
Yes
Sun–Abraham (2021)
Binned event-study + reweight
No
Yes
de Chaisemartin–D’Haultfœuille (2020)
Clean “switch-out” 2×2s
No
Yes
Borusyak–Jaravel–Spiess (2024)
Impute missing counterfactuals
No (implicitly)
Yes
Wooldridge (IW / efficient)
Unconditional GTAT + weighting
No
Yes
5. Reference Data: mpdta
County-level teen employment near state borders, March CPS 2003–2007. States raised the minimum wage in 2004, 2006, or 2007; bordering counties in non-raising states are never-treated controls. The dataset has 500 counties × 5 years = 2,500 observations.
Variable
Description
countyreal
County identifier
year
2003, 2004, 2005, 2006, 2007
lemp
Log of county teen employment rate (outcome)
first.treat
Year of first treatment: 0 (never), 2004, 2006, 2007
treat
Time-invariant ever-treated indicator (1 for all years of treated counties)
D (created)
Time-varying currently-treated dummy
Published benchmark: Callaway–Sant’Anna group ATT ≈ −0.0132 (SE 0.012) — a small, statistically insignificant negative employment effect.
did2s (v1.2.1). For more information on the methodology, visit <https://www.kylebutts.github.io/did2s>
To cite did2s in publications use:
Butts & Gardner, "The R Journal: did2s: Two-Stage
Difference-in-Differences", The R Journal, 2022
A BibTeX entry for LaTeX users is
@Manual{,
title = {did2s: Two-Stage Difference-in-Differences Following Gardner (2021)},
author = {Kyle Butts and John Gardner},
year = {2021},
url = {https://journal.r-project.org/articles/RJ-2022-048/},
}
Attaching package: 'did2s'
The following object is masked from 'package:bacondecomp':
castle
# ===== Setup: time-varying treatment + relative event time =====mpdta$D <-1* (mpdta$year >= mpdta$first.treat & mpdta$first.treat >0)mpdta$rel_year <-ifelse(mpdta$first.treat ==0, Inf, mpdta$year - mpdta$first.treat)# ---- 1. NAIVE TWFE (diagnostic only) ----twfe <-feols(lemp ~ D | countyreal + year, data = mpdta, vcov =~countyreal)summary(twfe) # ~ -0.012 ; DO NOT trust under heterogeneity