Math for Causal Inference
All simulators

The Goodman-Bacon Decomposition

Staggered adoption as four weighted 2×2 DiDs, including the forbidden comparison with already-treated units.

Day 70: Staggered Adoption: the Goodman-Bacon Decomposition
2468246810periodmean outcome2.5032%1.7536%1.5014%0.0018%
early vs neverlate vs neverearly vs not-yet-treated latelate vs already-treated earlyTWFEATT
TWFE = Σ weight × 2×2
1.636
ATT (treated unit-periods)
2.227
weight on forbidden comparison
18.2%
bias
-0.591

Three groups: early adopters, late adopters and never-treated, with a common trend. The TWFE coefficient equals the weighted sum of four 2×2 DiDs (bar heights; bar widths are the weights). With effects that grow over time, the comparison that uses already-treated early adopters as controls is biased, and TWFE drifts away from the average effect on treated unit-periods.