Tutorials › Econometrics (Graduate) › Stacked Difference-in-Differences Designs

Difference-in-Differences and Events · Tutorial 673 of 952

Stacked Difference-in-Differences Designs

Build cohort-specific stacks, understand the weighting choices they imply, and account for reused observations in inference.

Advanced 11 min read

What You'll Learn

  • Define cohort-specific event windows and eligibility rules for comparison units.
  • Distinguish controls that remain untreated throughout a window from controls eligible only through a particular event time.
  • Derive the cohort-specific difference-in-differences contrast under parallel trends and no anticipation.
  • Explain how stacking and aggregation choices weight cohorts and duplicated units.
  • Identify why inference must account for the same original unit appearing in multiple stacks.

Why Stack the Data?

With staggered adoption, treatment begins in different periods for different cohorts. A stacked difference-in-differences design makes comparisons cohort by cohort: for each treatment cohort, it builds a separate event-window dataset containing that cohort and units that are eligible controls for its window. The resulting datasets, or stacks, are then combined for estimation or summarized into cohort-specific effects.

The design makes the comparison explicit, but it does not automatically solve every problem of weighting or inference. A unit can be a control in several stacks, so one original observation may appear several times in the stacked data. The researcher must therefore define the target effects, specify how they are aggregated, and account for reuse when calculating uncertainty.

Define Cohorts, Windows, and Eligible Controls

Let \(G_i\) denote unit \(i\)'s first treatment period, with \(G_i=\infty\) for a never-treated unit. Assume treatment is absorbing: after period \(G_i\), unit \(i\) remains treated. For a cohort first treated in period \(g\), choose a pre-treatment window of length \(L\) and a post-treatment window of length \(H\). The calendar periods in that stack are \(g-L,\ldots,g+H\), and event time is \(k=t-g\).

Definition: The stack for cohort \(g\) contains observations from periods \(t\in[g-L,g+H]\) for (1) treated units with \(G_i=g\) and (2) eligible comparison units. A common strict eligibility rule includes only units with \(G_i>g+H\) or \(G_i=\infty\). Such controls are untreated throughout the entire window. A unit may be included in more than one cohort's stack, and each appearance is a separate stacked row linked to the same original unit.

The strict rule avoids comparing a treated cohort with units that become treated during its event window. In some applications, a control group may instead be defined separately for each event time, requiring a unit to remain untreated only through \(g+k\). That rule can enlarge the comparison group at later horizons, but it changes the comparison sample across event times. Eligibility must match the effect being estimated; it should not be chosen merely to maximize the number of observations.

Window endpoints also matter. If treatment may affect outcomes before its recorded start, the analysis must define treatment timing to reflect that anticipation, or exclude affected pre-treatment periods. Data must be available for the selected periods, and the treated and comparison groups must have adequate overlap. Different cohorts can use different window lengths, but resulting effects then refer to different event-time ranges and potentially different samples.

Worked Example: Selecting Controls for a Cohort Window

Suppose three cohorts first adopt a policy in periods 4, 6, and 9, and a fourth group is never treated. For the cohort treated in period \(g=4\), choose \(L=1\) and \(H=2\). Its window is periods 3 through 6.

Under the strict rule, controls must satisfy \(G_i>6\) or be never treated. Thus the cohort treated in period 6 is not eligible: it becomes treated during the window. The cohort treated in period 9 and the never-treated group are eligible. The period-4 cohort is the treated group for this stack.

For the cohort treated in period 6, using the same window lengths gives periods 5 through 8. The period-9 cohort and never-treated units are eligible controls. A never-treated unit can therefore appear in both stacks. An original outcome observed for that unit in period 6 is represented once in the period-4 stack and once in the period-6 stack, with a different stack label.

What a Cohort-Specific Contrast Identifies

Let \(Y_{it}(0)\) be unit \(i\)'s outcome in period \(t\) without treatment, and let \(Y_{it}(g)\) be its outcome if treatment begins in period \(g\). For a treated cohort and event time \(k\), the cohort-specific average treatment effect on the treated is

$$ ATT_{g,k} = E\!\left[Y_{i,g+k}(g)-Y_{i,g+k}(0)\mid G_i=g\right]. $$

A standard identification argument uses consistency, no anticipation, and a parallel-trends condition for the treated cohort and its eligible controls. Consistency links observed outcomes to the potential outcome under the treatment actually received. No anticipation means \(Y_{it}=Y_{it}(0)\) before treatment for the cohort being studied. Parallel trends requires that, absent treatment, the cohort's mean outcome change from the baseline period \(g-1\) to \(g+k\) would equal the corresponding change for the eligible controls. This can be stated conditionally on covariates when the design justifies that adjustment.

Identification result: For \(k\geq 0\), if eligible controls are untreated in both \(g-1\) and \(g+k\), consistency holds, there is no anticipation, and cohort-specific parallel trends holds over those periods, then $$ ATT_{g,k} = \left\{E[Y_{i,g+k}-Y_{i,g-1}\mid G_i=g]\right\} - \left\{E[Y_{i,g+k}-Y_{i,g-1}\mid i\text{ is eligible control for }g]\right\}. $$

The result follows by adding and subtracting the treated cohort's mean untreated change. In the treated group, consistency at \(g+k\) and no anticipation at \(g-1\) make the observed change equal to the untreated change plus the treatment effect. In the control group, outcomes are untreated at both dates. Parallel trends equates the two groups' mean untreated changes, leaving only \(ATT_{g,k}\).

$$ \begin{aligned} &E[Y_{i,g+k}-Y_{i,g-1}\mid G_i=g]\\ &=ATT_{g,k} +E[Y_{i,g+k}(0)-Y_{i,g-1}(0)\mid G_i=g],\\ &E[Y_{i,g+k}-Y_{i,g-1}\mid i\text{ is eligible control for }g]\\ &=E[Y_{i,g+k}(0)-Y_{i,g-1}(0)\mid i\text{ is eligible control for }g]. \end{aligned} $$

Subtracting the second expression from the first cancels the untreated change under parallel trends. This is an identification statement, not a guarantee that a particular pooled regression estimates a desired average without further choices. For lead periods \(k<0\), analogous contrasts can describe pre-treatment differences, but they are diagnostics rather than treatment effects under no anticipation.

Worked Example: A Two-Period Contrast Within One Stack

Consider a hypothetical cohort treated in period 4. Compare its mean outcome in period 5 with period 3, the baseline \(g-1\). The treated cohort's mean rises from 100 to 120 units. Its eligible controls' mean rises from 80 to 90 units. The sample difference-in-differences contrast is

$$ (120-100)-(90-80)=20-10=10\text{ units}. $$

The estimated effect at event time \(k=1\) is 10 outcome units for this cohort, provided the identification conditions are credible. The arithmetic alone does not establish those conditions: the controls must remain untreated through period 5, there must be no anticipation affecting the period-3 baseline, and the untreated outcome trends for the two groups must be parallel over periods 3 to 5.

Regression and Aggregation Choices

A stacked regression should distinguish stack-specific comparisons. Let \(s\) index the cohort stack, \(D_{is}=1\) for a treated unit in that stack and \(0\) for its controls, and \(t\) denote calendar time. A flexible event-study specification includes unit-within-stack and time-within-stack effects, then estimates treated-by-event-time interactions. One way to write it is

$$ Y_{ist} = \alpha_{is}+\lambda_{st} + \sum_g\sum_{k\ne -1} \beta_{gk}\, \mathbf{1}\{s=g\}D_{is}\mathbf{1}\{t-g=k\} +\varepsilon_{ist}. $$

Here \(\alpha_{is}\) is a fixed effect for original unit \(i\) as it appears in stack \(s\), and \(\lambda_{st}\) is a stack-by-calendar-time effect. Event time \(-1\) is the omitted baseline. The \(\beta_{gk}\) coefficients are cohort-specific contrasts relative to that baseline, subject to the regression's sample and weighting scheme. A regression that instead constrains the interaction effects to be common across cohorts imposes a common-effect restriction; absent that restriction, pooling produces a weighted combination whose weights depend on the design and estimation choices.

After estimating cohort-specific effects, an analyst may report an aggregate such as \(\sum_g \omega_g ATT_{g,k}\), where \(\omega_g\geq0\) and \(\sum_g\omega_g=1\). Equal-cohort weights answer a different question from weights proportional to treated cohort size. Neither is universally correct: the weights define the population summary. Regression weights and repeated rows can also affect the estimated combination, so the reported target should be stated explicitly.

Worked Example: Equal-Cohort and Size-Weighted Effects

Suppose the estimated event-time effect is 10 outcome units for cohort A and 4 units for cohort B. If the target gives each cohort equal weight, the aggregate is

$$ \frac{1}{2}(10)+\frac{1}{2}(4)=7\text{ units}. $$

If instead cohort A has 90 treated units and cohort B has 10, an aggregate weighted by treated cohort size is

$$ \frac{90}{100}(10)+\frac{10}{100}(4)=9.4\text{ units}. $$

Both calculations use the same cohort-specific effects but answer different aggregation questions. These arithmetic examples define explicit weights; a pooled regression should not be assumed to use either set of weights unless its specification and estimation sample actually imply them.

Duplicated Observations, Weights, and Inference

Stacking changes the data representation, not the identity of the original units. When one control unit appears in three stacks, its outcome-period observation contributes three stacked rows. In an unweighted least-squares objective, those rows contribute three times, while a row that appears once contributes once. Thus duplication can alter the influence of units and the implicit cohort aggregation. It is not harmless merely because each copy has a different stack label.

Worked Example: One Control Reused Across Stacks

Suppose an eligible comparison unit appears in three cohort stacks, while another comparison unit appears in only one. For a particular calendar period, the first unit's observed outcome is 50 units and the second's is 70 units. If these four stacked rows are averaged without adjustment, the average is

$$ \frac{50+50+50+70}{4}=55\text{ units}. $$

The mean of the two distinct original units is instead

$$ \frac{50+70}{2}=60\text{ units}. $$

The difference arises because the first unit is represented three times. This example isolates the weighting arithmetic; actual regression coefficients also depend on fixed effects and the full set of rows. Researchers can choose explicit stack or unit weights to target a specified population summary, but should verify that the chosen weights operate as intended in the fitted design.

The duplicated rows also cannot be treated as independent observations for uncertainty estimation. Copies share the same original outcome and may be linked to the same treatment-assignment unit. Standard errors should account for dependence at the original unit level, or at the higher level at which treatment is assigned when that is the relevant dependence structure. Clustering only on a newly constructed stack-unit identifier can incorrectly treat copies of one original unit as independent. The covariance calculation must respect both repeated observations over time and cross-stack reuse.

Common Pitfalls and Design Checks

  • Allowing already-treated units into a control group. A unit treated during the cohort's event window is not untreated at every comparison date. Under the strict rule, require \(G_i>g+H\) or \(G_i=\infty\).
  • Assuming stacking removes all treatment-effect heterogeneity. Stacks organize comparisons; they do not make effects common across cohorts or event times. Specify and interpret the aggregation.
  • Calling each stacked row a new independent unit. Repeated rows are copies of original observations. Link them to the original unit and account for that dependence in inference.
  • Leaving weights implicit. A pooled estimate can reflect cohort size, control reuse, window length, and regression specification. State the intended target and check how the fitted procedure weights it.
  • Treating a pre-period coefficient as proof of parallel trends. A diagnostic contrast can reveal some departures, but failure to detect a difference does not establish the counterfactual parallel-trends condition.
Key takeaway: A stacked design is defined by its cohort-specific windows, eligible controls, and weighting scheme. Its causal interpretation depends on the relevant no-anticipation and parallel-trends assumptions, while valid inference must recognize that original units may be reused across stacks.

Check Your Understanding

Answer each question by stating the relevant comparison or weighting choice.

  1. A cohort is first treated in period 8, and its stack runs from period 6 through period 10. Under the strict eligibility rule, can a unit first treated in period 10 serve as a control? Why?
  2. State the cohort-specific difference-in-differences contrast for event time \(k=2\) using period \(g-1\) as the baseline.
  3. Two cohorts have effects of 6 and 12 units. What is their equal-cohort aggregate, and how would you describe its target?
  4. Why can a control unit's appearance in several stacks affect a pooled least-squares estimate?
  5. What is wrong with clustering standard errors only by a stack-specific unit identifier when the same original unit appears in multiple stacks?
Clinical Biostats