







The equivalence holds for the following reasons:
- DiD setup: The classic DiD estimator is based on a "difference of differences" calculation from the mean outcomes of four groups: treated pre-period, treated post-period, control pre-period, and control post-period.
- TWFE regression: A TWFE regression for the 2x2 case includes fixed effects for the two time periods and the two groups, plus an interaction term for the treatment.
- Equivalence: The coefficient on the treatment interaction term in the TWFE regression mathematically reproduces the standard DiD calculation.
The relationship is not equivalent, however, in more complex or "generalized" DiD designs involving:
- Multiple time periods: The TWFE estimator is no longer the same as a single DiD calculation.
- Staggered treatment adoption: When different units receive treatment at different times, the standard TWFE estimator becomes a weighted average of all possible 2x2 comparisons in the data.
- Heterogeneous treatment effects: If the treatment effect is not constant across groups or time, the simple TWFE estimator can produce biased estimates. The bias occurs because the TWFE model implicitly uses "already-treated" units as controls for "not-yet-treated" units, which can lead to misleading comparisons and potentially negative weights.
How they’re similar
- All rely on the parallel trends assumption.
- All compare treated vs untreated outcomes, netting out common shocks.
- All can be estimated via regression models with fixed effects.