Why Decompose a TWFE Coefficient?
When units adopt treatment at different dates, a familiar two-way fixed-effects (TWFE) regression produces one treatment coefficient. That single number can conceal several comparisons: a cohort adopting treatment may be compared with never-treated units, with cohorts that have not adopted yet, or with cohorts that adopted earlier. To interpret the coefficient, it helps to identify these underlying comparisons and how the design weights them.
The decomposition is an algebraic description of the regression coefficient. By itself, it does not establish that every comparison estimates a causal effect. That requires assumptions about the untreated outcomes, including appropriate parallel trends, and about when treatment can begin to affect outcomes.
Setup and Two-by-Two Comparisons
Consider a balanced panel of units \(i\) observed in calendar periods \(t=1,\ldots,T\). Each unit belongs to an adoption cohort \(G_i\), the first period in which it is treated; never-treated units have \(G_i=\infty\). Treatment is absorbing, so \(D_{it}=\mathbf{1}\{t\geq G_i\}\). The conventional TWFE regression is
Here \(\alpha_i\) and \(\lambda_t\) are unit and calendar-time fixed effects. The coefficient \(\beta_{\mathrm{TWFE}}\) is the linear-regression coefficient on the binary treatment indicator after accounting for those fixed effects.
In a staggered design, the identities of these groups and periods matter. A cohort can be compared with a never-treated cohort around its own adoption date. Two adoption cohorts can also be compared: an earlier adopter may be treated while a later adopter is not yet treated, or a later adopter may adopt after the earlier cohort is already treated. In the latter comparison, the earlier cohort is not an untreated group during the comparison window.
Worked Example: Labeling the Comparisons
Suppose a hypothetical panel follows three cohorts in periods 1 through 4. Cohort A adopts in period 2, cohort B adopts in period 3, and cohort N is never treated. The treatment indicators are:
| Cohort | Period 1 | Period 2 | Period 3 | Period 4 |
|---|---|---|---|---|
| A | 0 | 1 | 1 | 1 |
| B | 0 | 0 | 1 | 1 |
| N | 0 | 0 | 0 | 0 |
A-versus-N can provide a treated-versus-never-treated comparison: period 1 is before A's adoption, and periods 2–4 are after it. B-versus-N has period 3 as B's first treated period, following untreated periods 1–2. A-versus-B also supplies two distinct timing comparisons. From period 1 to 2, A adopts and B has not yet adopted; from period 2 to 3, B adopts while A is already treated. These labels describe which groups and periods are being compared; they do not, on their own, establish that any contrast has a causal interpretation.
The Weighted-Comparison Representation
For a balanced panel with absorbing, cohort-specific adoption and a common set of observed periods, the Goodman-Bacon decomposition expresses the TWFE treatment coefficient as a weighted average of two-by-two DiD comparisons. The comparisons fall into three broad types: adoption cohorts versus never-treated units; earlier adopters versus later adopters while the later cohort is not yet treated; and later adopters versus earlier adopters after the earlier cohort has adopted.
The weights are design weights: they describe how much each comparison contributes to the regression coefficient. They are not generally the proportions of units in the corresponding cohorts, nor are they chosen to average particular cohort-time treatment effects. The precise comparisons and weights depend on which cohorts exist, their relative sizes, and how much treatment status changes across the observed periods. Thus, two designs with different adoption timing can assign different weights even if their outcomes follow the same pattern.
This theorem has an important scope. Its weighted-average statement applies to the two-by-two comparison estimates in the decomposition. It does not say that the TWFE coefficient is necessarily a transparent average of cohort-time average treatment effects. A two-by-two estimate involving an already-treated cohort as the comparison group is still part of the regression’s algebraic representation, but its causal meaning needs separate scrutiny.
Why the Decomposition Holds
A short derivation begins with the Frisch-Waugh-Lovell result for linear regression: after residualizing treatment and outcome with respect to unit and time fixed effects, the coefficient is the inner product of those residuals divided by the residual sum of squares for treatment. Write \(\widetilde D_{it}\) for treatment after removing its unit and time means, and \(\widetilde Y_{it}\) for outcome after the same operation. Then
The treatment residuals encode all the changes in treatment status that remain after fixed effects have been removed. In the staggered-adoption design, those changes can be organized by pairs of cohorts and by the periods around their adoption dates. The decomposition partitions the regression’s treatment variation across the resulting two-by-two comparisons. For each comparison, the corresponding share of that variation supplies its design weight; the shares add to the total residual treatment variation. Rewriting the numerator using those same comparison components gives the weighted sum of their DiD estimates. Dividing by the total variation gives weights that sum to one.
A useful check on the interpretation is the special case of one adopting cohort and one never-treated cohort. There is only one timing contrast: treated versus never treated. With one pre-period and one post-period, the two-group, two-period fixed-effects regression coefficient is exactly the ordinary DiD. With multiple periods, the two-group regression still summarizes the pre/post changes, but the averaging over periods must match the regression's treatment pattern.
Worked Example: One Adopting Cohort and One Never-Treated Cohort
In a hypothetical two-period panel, suppose the treated cohort's mean outcome is 10 before adoption and 16 after adoption. The never-treated cohort's mean is 8 before and 11 after. There are no other groups or periods in this example.
The treated cohort's change is \(16-10=6\) outcome units. The never-treated cohort's change is \(11-8=3\) outcome units. Therefore the only two-by-two comparison is
In this two-group, two-period design, the TWFE treatment coefficient equals 3 outcome units. This equality follows from the design: there is only one DiD contrast to contribute. Calling 3 a causal effect would additionally require that, without treatment, the treated cohort would have experienced the same mean outcome change as the never-treated cohort, along with no treatment anticipation and the other conditions needed for the outcome and treatment definitions to be appropriate.
Worked Comparisons in a Staggered Design
The next example calculates several cohort-time contrasts from hypothetical outcome means. Its purpose is to show what goes into the two-by-two comparisons. It does not assign the TWFE decomposition weights, which require the full treatment design rather than outcome means alone.
Worked Example: Early-versus-Later and Later-versus-Earlier
Consider hypothetical mean outcomes for the cohorts in the first example. Suppose cohort A's means are 0, 2, 4, and 4 in periods 1–4; cohort B's means are 0, 0, 3, and 3; and never-treated cohort N's means are 0 in every period.
For the early-adopter-versus-later-adopter comparison from period 1 to period 2, A is treated in period 2 and B is not yet treated. The DiD is
For the later-adopter-versus-earlier-adopter comparison from period 2 to period 3, B adopts while A is already treated. The arithmetic is
For comparison, A versus N from period 1 to period 2 gives \((2-0)-(0-0)=2\) outcome units, and B versus N from period 2 to period 3 gives \((3-0)-(0-0)=3\) outcome units. These are distinct DiD contrasts. The TWFE coefficient is not found by simply taking their unweighted average: the decomposition uses design-specific weights and may include comparisons across other relevant periods as well.
The last contrast uses A as the comparison group even though A is treated in both periods. The arithmetic is well-defined, but interpreting it causally requires care. For example, the change in A's outcome during the window need not represent the untreated change that B would have experienced.
From Algebra to Causal Interpretation
The decomposition is an identity for the specified regression and design. Causal interpretation is a further step. For a particular DiD comparison, a central requirement is that, absent treatment, the compared groups would have had the same mean outcome change across the selected periods. This is a comparison-specific parallel-trends condition. The relevant groups must also be untreated in the periods used to represent their untreated outcomes, or the analysis must otherwise justify using their outcomes for that purpose. No anticipation is needed so that outcomes before adoption are not already affected by future treatment.
These requirements should be considered for the actual comparisons contributing to the coefficient. It is not enough to say that a general parallel-trends assumption holds without specifying which groups and periods it concerns. Likewise, the exact regression decomposition does not verify parallel trends, no anticipation, or any other identifying assumption. Those assumptions concern how observed outcome changes relate to the outcomes that would have occurred without treatment.
Worked Example: Checking the Interpretation of a Comparison
Suppose a researcher wants to interpret the period 1-to-2 A-versus-B contrast from the preceding example as an effect for A in period 2. A adopts in period 2, whereas B is untreated in both periods of this comparison. The observed DiD is 2 outcome units.
A causal interpretation requires, among other conditions, that in the absence of A's treatment, A's mean outcome would have changed from period 1 to period 2 by the same amount as B's mean outcome did. In the hypothetical data, B's observed change is \(0-0=0\). Under the comparison's parallel-trends assumption and no anticipation, A's untreated change would therefore also be 0; A's observed change is \(2-0=2\). The implied effect for A in period 2 is \(2-0=2\) outcome units.
This reasoning is conditional on the stated assumptions. The observed means alone cannot establish what A's untreated outcome would have been. The comparison's arithmetic is exact, but its causal interpretation is not guaranteed by the TWFE regression or by the decomposition theorem.
Common Mistake: Treating the Coefficient as a Simple Effect Average
- Wrong reasoning: “TWFE has one treatment coefficient, so it must be the average treatment effect across treated units.” A single regression coefficient does not, by itself, specify which cohorts, periods, and contrasts are being averaged.
- Correction: Identify the adoption cohorts and periods, then recognize the two-by-two comparisons and their design-dependent weights. The coefficient is exactly a weighted combination of those comparisons under the stated design, but causal interpretation depends on the assumptions for the comparisons involved.
- Wrong reasoning: “Because a comparison is included in the algebraic decomposition, it must be a valid control comparison.” Regression algebra does not make an already-treated cohort untreated.
- Correction: Separate the algebraic question—what comparisons make up the coefficient?—from the identification question—does each comparison recover a causal effect for the target of interest?
Check Your Understanding
Use the definitions and comparisons in this tutorial to answer the following.
- In a staggered-adoption panel, what does a two-by-two DiD comparison subtract from the treated group's outcome change?
- With one adopting cohort and one never-treated cohort, which comparison type is available?
- What features of the design determine the weights in the TWFE decomposition?
- Why does an exact regression decomposition not establish that its DiD comparisons have causal interpretations?
- In a comparison where a later adopter is contrasted with an earlier adopter after the earlier cohort has adopted, what additional issue must be considered before interpreting the contrast causally?