Why Decompose a Two-Way Fixed-Effects Estimate?
With staggered adoption, different groups begin treatment in different periods. A familiar two-way fixed-effects (TWFE) regression can still produce one coefficient, but that coefficient may combine several comparisons: treated groups versus never-treated groups, and groups treated at different dates. The Goodman-Bacon decomposition makes those comparisons visible. In particular, it identifies when a later-treated group is compared with an earlier-treated group that is already receiving treatment.
This matters because a two-by-two difference-in-differences (DiD) comparison with a not-yet-treated or never-treated control can have a causal interpretation under appropriate assumptions, while a comparison using an already-treated control may instead reflect differences in how treatment effects evolve across groups. The decomposition is a diagnostic of what the TWFE coefficient combines; it does not, by itself, establish that those comparisons identify causal effects.
Setup and Decomposition
For a two-group, two-period comparison, let \(G\) be the group whose treatment status changes from untreated to treated and \(C\) be the comparison group, which remains untreated over the comparison window. The DiD estimate is the change in \(G\)'s mean outcome minus the change in \(C\)'s mean outcome:
When the comparison group is untreated throughout the window, parallel trends for the relevant groups and periods, no anticipation, and a well-defined treatment can support a causal interpretation. Those assumptions concern interpretation, not the algebraic decomposition itself.
The two-way fixed-effects coefficient is not generally just one such clean comparison. Its component comparisons fall into three broad classes:
- Treated versus never-treated: a cohort that adopts treatment is compared with a cohort that remains untreated.
- Earlier-treated versus later-treated: the earlier-treated cohort is compared with the later-treated cohort before the latter adopts treatment. The later cohort is untreated in the comparison window.
- Later-treated versus earlier-treated: the later-treated cohort is compared with the earlier-treated cohort after the earlier cohort has already adopted. The earlier cohort is then an already-treated control.
The first two types can provide clean DiD comparisons, subject to identification assumptions. The third type is different: the control group's outcome may itself respond to treatment. It is therefore not generally a valid estimate of the later cohort's treatment effect.
How the Weights Work
Each component receives a nonnegative weight, and the weights sum to one. A component's weight reflects how much treatment variation that comparison contributes to the TWFE regression. In the decomposition, this contribution is determined by the sample and the variation in treatment status after accounting for the relevant unit and time effects. Components with more such residualized treatment variation receive more weight.
Here \(j\) indexes the two-by-two components in the decomposition, and \(\omega_j\) is component \(j\)'s weight. The nonnegative weights apply to the component DiD estimates. They do not guarantee that \(\hat{\beta}\) is a nonnegative-weighted average of causal treatment effects: a component using an already-treated control can itself combine treatment effects in a way that subtracts one effect from another.
Why the Decomposition Holds
The algebra comes from the Frisch-Waugh-Lovell theorem: in a regression with fixed effects, the coefficient on treatment equals the slope from regressing the outcome after removing unit and time means on treatment after removing those same means. In a balanced panel, units can be grouped by adoption date. The residualized treatment variation can then be organized into the two-by-two comparisons between those timing groups. Each comparison contributes its own DiD slope, weighted by its contribution to the residualized treatment variation.
Subtracting unit and time effects isolates the variation in treatment and outcomes used to estimate the TWFE coefficient.
Within a cohort, treatment follows the same absorbing adoption pattern. Comparing cohorts therefore reveals the timing contrasts that generate the remaining treatment variation.
For two cohorts and a relevant time window, the two-way fixed-effects slope is the difference between their outcome changes. When treatment timing differs, the window may place one cohort in the already-treated control role.
Adding the component contributions gives the full TWFE coefficient. Normalizing their treatment-variation contributions produces nonnegative weights that sum to one.
This argument explains the structure of the result, but not a universal numerical weight formula independent of the design. Group sizes, the number and arrangement of periods, and the adoption pattern all affect the component weights. In practice, report the estimated component comparisons and their design-based weights rather than assuming that each comparison counts equally.
Worked Example: A Clean Earlier-versus-Later Comparison
Suppose a hypothetical panel records weekly earnings in dollars for an early-adopting group and a later-adopting group. Compare period 0 with period 1, before the later group adopts. The early group’s mean earnings rise from $600 to $680, while the later group’s mean rises from $620 to $660.
The early group is treated by period 1; the later group is not yet treated. The two-by-two estimate is:
The estimate is $40 per week. If the groups would have followed parallel outcome trends over these periods in the absence of treatment, there was no anticipation, and other identification conditions hold, this comparison estimates the early group’s average treatment effect for this period. Without those assumptions, it remains a calculated difference in outcome changes, not a guaranteed causal effect. The later group is a clean control here because it has not yet adopted treatment.
Worked Example: An Already-Treated Control Can Reverse the Comparison
Now compare periods 1 and 2. The later group adopts treatment in period 2, but the early group has been treated since before period 1. Suppose the early group’s mean earnings rise from $600 to $700, and the later group’s mean rises from $550 to $620. Their difference in changes, with the later group as the group newly treated, is:
This negative estimate does not show that treatment reduced the later group’s earnings. For illustration, suppose the untreated earnings trend would have been an increase of $20 per week in each group. Suppose the later group’s new treatment effect in period 2 is $50 per week, so its observed change is $20+$50=$70. Suppose the early group’s treatment effect increases by $80 per week between periods 1 and 2, so its observed change is $20+$80=$100. The comparison subtracts the early group’s treatment-related increase from the later group’s increase, giving $50-$80=-$30.
The example shows why the already-treated comparison is problematic under treatment-effect heterogeneity or changing effects. The early group’s change is not an untreated counterfactual trend for the later group. Even with common untreated trends, the comparison can be negative because the treatment effects evolve differently.
Worked Example: Reading a Weighted Decomposition
Consider a hypothetical decomposition with four components. The first two compare treated cohorts with a never-treated cohort; the third compares an earlier-treated cohort with a later cohort while the latter is still untreated; the fourth compares the later cohort with the already-treated earlier cohort. Suppose the decomposition reports the following component estimates and weights:
| Component | DiD estimate (dollars per week) | Weight |
|---|---|---|
| Treated versus never-treated, first cohort | $4 | 0.30 |
| Treated versus never-treated, second cohort | $5 | 0.25 |
| Earlier-treated versus not-yet-treated | $4 | 0.20 |
| Later-treated versus already-treated | −$3 | 0.25 |
The weights sum to \(0.30+0.25+0.20+0.25=1.00\). The TWFE coefficient is the weighted sum:
The reported TWFE coefficient is $2.50 per week. The last component contributes \(-\$0.75\) to this total, even though its weight is positive, because its own DiD estimate is negative. These numbers illustrate how to read a decomposition; the weights must come from the design and its decomposition, not from choosing convenient values. The overall coefficient should not be described as an average causal effect without establishing that the component comparisons identify appropriate causal effects.
Interpreting the Decomposition in Practice
The decomposition answers a specific question: which two-by-two comparisons, and how much of each, produce the TWFE coefficient? It does not test parallel trends, establish that adoption timing is exogenous, or supply a replacement causal estimand. To evaluate causal meaning, examine what is being compared and whether the relevant identification assumptions are plausible for those groups and periods.
In particular, a large weight on later-treated-versus-already-treated comparisons is a warning that the TWFE coefficient relies substantially on comparisons with treated controls. If treatment effects vary across adoption cohorts or over time since adoption, those components can pull the regression coefficient away from a simple average of treatment effects. A small weight on such comparisons does not itself establish validity: the remaining comparisons still need defensible assumptions.
Common Mistake
A common mistake is to see that all decomposition weights are nonnegative and conclude that the TWFE coefficient is a conventional average treatment effect. That conclusion does not follow. Nonnegative weights describe how the regression combines the two-by-two estimates; they do not ensure that every estimate is a causal effect. When an already-treated group serves as a control, its own treatment response enters the comparison. With heterogeneous or evolving effects, that component can subtract one treatment effect from another. The correction is to identify the comparison types, inspect their weights, and state the assumptions needed for any causal interpretation.
Check Your Understanding
Use the definitions and examples above to answer these questions.
- In an earlier-treated-versus-later-treated comparison made before the later cohort adopts, which cohort is untreated in the comparison window?
- Why does a later-treated-versus-already-treated comparison generally fail to use an untreated control?
- A decomposition assigns weights of 0.40 and 0.60 to component estimates of $3 and −$1 per week. What is the weighted coefficient?
- Do nonnegative decomposition weights establish that the TWFE coefficient is an average causal effect? Explain.
- Name two assumptions that can support a causal interpretation of a clean two-by-two DiD comparison.