Tutorials › Causal Inference › Pooling Multiple Pre- and Post-Intervention Periods

Difference-in-Differences · Tutorial 590 of 972

Pooling Multiple Pre- and Post-Intervention Periods

Compare equal-period and explicitly weighted DiD averages, and see how the post-period weights define the average treatment effect being estimated.

Intermediate 10 min read

What You'll Learn

  • Define weighted pre- and post-intervention averages for repeated-period DiD.
  • Calculate an equal-period DiD estimate from multiple pre- and post-period means.
  • Calculate an explicitly weighted estimate and check the weight arithmetic.
  • Explain how post-period weights define the weighted average treatment effect.
  • Distinguish equal-period weighting from pooling observations in proportion to sample size.
  • State the parallel-trends condition needed to interpret the weighted contrast causally.

Why Pooling Periods Requires a Weighting Rule

When an intervention begins on a common date, data may include several periods before it and several periods after it. A single difference-in-differences (DiD) number then requires a decision: how much should each period contribute? Giving every period equal weight is one option, but it is not the only one. If later post-intervention periods matter more for the question, or if the target is an average across a particular distribution of periods, explicit weights may be more appropriate.

The arithmetic choice also defines the quantity being summarized. An estimate that gives each post period equal weight targets an average effect across those periods. An estimate that gives some post periods more weight targets a different average. Neither weighting rule is automatically correct for every question; the weights should be stated and matched to the intended estimand.

Definition: Let \(G_t\) be the difference between the treated-group and control-group mean outcomes in period \(t\). Let \(a_j\) be the weight on pre-intervention period \(j\), and \(b_k\) the weight on post-intervention period \(k\). The weighted repeated-period DiD contrast is $$ \widehat{\Delta}(a,b)=\sum_{k=1}^{K} b_k G_k-\sum_{j=1}^{J} a_j G_j, $$ where the pre-period weights sum to one and the post-period weights sum to one. The weights specify how period gaps are averaged on each side of the intervention.

In this tutorial, weights are nonnegative unless stated otherwise. Nonnegative weights make each side a conventional weighted average. Equal weighting means \(a_j=1/J\) for each of the \(J\) pre periods and \(b_k=1/K\) for each of the \(K\) post periods. Other weights can reflect a prespecified target, such as emphasizing a particular follow-up period.

Equal Weight for Every Period

A natural starting point is to average the group means separately across all pre periods and all post periods, then take the difference in those changes. Equivalently, calculate the average treated-control gap after the intervention and subtract the average treated-control gap before it. Each period contributes equally, even if periods have different sample sizes.

Worked Example: Equal Weight Across Two Pre and Three Post Periods

Suppose a hypothetical program begins between the second and third periods. The entries below are group mean outcomes measured in points. Assume the same outcome definition and comparable group populations in each period.

PeriodTimingTreated meanControl meanGap \(G_t\)
1Pre50455
2Pre52466
3Post56488
4Post604911
5Post594712

With equal weights, the average pre-intervention gap is \((5+6)/2=5.5\) points. The average post-intervention gap is \((8+11+12)/3=31/3\), or about 10.333 points. Therefore,

$$ \widehat{\Delta}_{\mathrm{equal}} =\frac{8+11+12}{3}-\frac{5+6}{2} =10.333-5.5 \approx 4.833\text{ points}. $$

The same result follows by averaging the group means first. The treated-group pre average is \((50+52)/2=51\), and its post average is \((56+60+59)/3=58.333\), a change of 7.333 points. The control-group pre average is \((45+46)/2=45.5\), and its post average is \((48+49+47)/3=48\), a change of 2.5 points. Subtracting the changes gives \(7.333-2.5=4.833\) points. This is a descriptive DiD contrast; a causal interpretation additionally requires an appropriate parallel-trends condition.

This calculation gives equal influence to each period, not to each observation. A period with many observations and a period with few observations each contribute one-third to the post average in this example. That distinction matters when deciding what population or time distribution the average is meant to describe.

Explicit Weights and the Target Average

Suppose there are two pre periods with weights \(a_1,a_2\) and three post periods with weights \(b_1,b_2,b_3\). The weights must be specified on each side and sum to one separately. One can then calculate the weighted pre gap and weighted post gap. The difference is the weighted DiD estimate.

Worked Example: Giving Later Post Periods More Weight

In a second hypothetical example, the pre-period gaps are 4 and 6 points, and the post-period gaps are 7, 11, and 15 points. Use equal weights for the pre periods, but use post weights \(1/6, 2/6,\) and \(3/6\), respectively. These post weights sum to one.

The weighted pre gap is \((4+6)/2=5\) points. The weighted post gap is

$$ \frac{1}{6}(7)+\frac{2}{6}(11)+\frac{3}{6}(15) =\frac{7+22+45}{6} =\frac{74}{6} \approx 12.333\text{ points}. $$

Thus the weighted DiD contrast is \(12.333-5=7.333\) points. To see the role of the weights, the post gaps exceed the pre reference gap of 5 by 2, 6, and 10 points. Their weighted average is

$$ \frac{1}{6}(2)+\frac{2}{6}(6)+\frac{3}{6}(10) =0.333+2+5 =7.333\text{ points}. $$

The final post period receives half the total post weight, so its larger gap has substantial influence. Equal post weights would instead give \((2+6+10)/3=6\) points. The two answers differ because they average the period-specific changes using different weights, not because one calculation is necessarily an error.

In the example, all post gaps are compared with the same weighted pre gap. More generally, the weighted contrast can be calculated directly from the weighted post and pre gaps. It can also be written as a weighted average of post-period DiD contrasts, provided each of those contrasts uses the same weighted pre-period reference. This makes clear that the post weights, rather than the number of pre periods, specify how the post-period effects are averaged.

Why the Weighted Contrast Can Have a Causal Interpretation

To state the causal interpretation precisely, let \(\mu_{Tt}(0)\) be the treated group’s mean outcome in period \(t\) if it were untreated, and let \(\mu_{Tt}(1)\) be its mean under treatment. For the control group, assume no treatment is received, and denote its mean outcome by \(\mu_{Ct}(0)\). In a post period \(k\), define the treated-group average effect as \(\tau_k=\mu_{Tk}(1)-\mu_{Tk}(0)\). Before the intervention, assume there is no anticipation: observed treated-group outcomes equal their untreated outcomes. These definitions concern group-period means, so they require that the means represent comparable target populations over time.

A weighted parallel-trends condition requires the weighted change in the untreated treated-control gap to be zero:

$$ \sum_{k=1}^{K} b_k\{\mu_{Tk}(0)-\mu_{Ck}(0)\} = \sum_{j=1}^{J} a_j\{\mu_{Tj}(0)-\mu_{Cj}(0)\}. $$

This condition says that, after applying the chosen weights, the treated and control groups would have the same average gap before and after the intervention if the treated group had remained untreated. A stronger, familiar version is that the untreated treated-control gap is constant in every period. Under that stronger condition, the displayed equality holds for any pre and post weights that each sum to one.

The result follows directly by substituting observed gaps. In a pre period, no anticipation gives the observed gap \(G_j=\mu_{Tj}(0)-\mu_{Cj}(0)\). In a post period, the treated group is observed under treatment while the control group remains untreated, so \(G_k=\mu_{Tk}(0)-\mu_{Ck}(0)+\tau_k\). Therefore,

$$ \begin{aligned} \Delta(a,b) &=\sum_k b_k\{\mu_{Tk}(0)-\mu_{Ck}(0)+\tau_k\} -\sum_j a_j\{\mu_{Tj}(0)-\mu_{Cj}(0)\}\\ &=\sum_k b_k\tau_k+ \left[ \sum_k b_k\{\mu_{Tk}(0)-\mu_{Ck}(0)\} -\sum_j a_j\{\mu_{Tj}(0)-\mu_{Cj}(0)\} \right]\\ &=\sum_k b_k\tau_k. \end{aligned} $$

The bracketed term is zero under weighted parallel trends. Thus the population contrast identifies the post-period effects averaged with weights \(b_k\). Equal post weights identify the simple average of the post-period effects; unequal post weights identify the corresponding weighted average. If weights are nonnegative and sum to one, this is a weighted average within the range of the period-specific effects. If weights are allowed to be negative, the algebra still defines a contrast, but it need not be an average in that ordinary sense.

Worked Example: Comparing Equal-Period and Observation-Weighted Targets

Suppose a hypothetical study has three post periods with period-specific DiD estimates of 2, 6, and 10 outcome points. Consider first the average effect across the three periods, assigning each period equal weight:

$$ \frac{1}{3}(2)+\frac{1}{3}(6)+\frac{1}{3}(10) =\frac{18}{3}=6\text{ points}. $$

Now suppose the period sample sizes are 10, 20, and 30, and the analyst explicitly chooses weights proportional to those sizes. The weights are \(10/60=1/6\), \(20/60=2/6\), and \(30/60=3/6\). The estimate is

$$ \frac{1}{6}(2)+\frac{2}{6}(6)+\frac{3}{6}(10) =0.333+2+5 \approx 7.333\text{ points}. $$

The second estimate is not the equal-period average: it gives more influence to the later periods because they have larger sample sizes. It can be interpreted as the average across periods under this chosen sample-size distribution, provided the causal assumptions hold for the relevant contrasts. Sample-size weighting does not automatically make that the scientifically preferred target. For example, if period populations or compositions differ, the analyst should consider whether the resulting weighted average answers the intended question.

Choosing and Reporting Weights

Before calculating a pooled estimate, state what the weights represent. Equal weights are transparent when the target is the average effect across observed periods, treating each period as equally important. Prespecified unequal weights can represent a target that emphasizes particular follow-up periods. Weights based on sample sizes instead emphasize periods with more observations; they do not, by themselves, resolve differences in who is represented in each period.

Also state the pre-period weights. Under the stronger condition of a constant untreated treated-control gap, any pre weights summing to one yield the same population baseline gap. In finite samples, different pre weights can still change the numerical estimate because the observed pre gaps vary. Under a weaker weighted parallel-trends condition, the chosen pre weights are part of the assumption itself: changing them can change whether the identifying condition is plausible and which contrast is being estimated.

A useful reporting sentence gives the periods, the weights on each side, the estimate and its outcome units, and the causal assumption behind its interpretation. For example: “The estimate is a post-period average with weights one-sixth, one-third, and one-half, compared with an equally weighted average of the two pre periods; under weighted parallel trends and no anticipation, it estimates the corresponding weighted average treatment effect in outcome points.”

Common Mistakes

  • Assuming that “pooled” means equal weights. Pooling can mean several different calculations. Write the weights explicitly and verify that they sum to one on each side.
  • Confusing period weights with observation counts. Equal weight per period is not the same as equal weight per person when period sample sizes differ.
  • Reporting one number without its target. A weighted average is not simply “the effect after treatment”; its post weights define which average of period effects it represents.
  • Treating the arithmetic as identification. Correctly calculated weights do not establish parallel trends, absence of anticipation, or comparable group-period means. Those conditions are needed for a causal interpretation.
  • Using weights that do not sum to one. If the pre and post weights do not each sum to one, a common constant gap may not cancel, and the contrast is not the stated difference of weighted averages.
Key takeaway: In repeated-period DiD, the pre and post weights define the two averages being contrasted. Under no anticipation and the corresponding weighted parallel-trends condition, the post weights also define the average of period-specific causal effects identified by the contrast.

Check Your Understanding

Answer each question by naming the relevant weights and, where appropriate, showing the calculation.

  1. There are four pre periods and two post periods. What are the equal weights for the pre and post averages?
  2. Three post-period effects are 1, 4, and 7 points. Calculate their average under equal weights and under weights \(1/2, 1/3,\) and \(1/6\), respectively.
  3. Explain why weighting post periods in proportion to sample size can target a different average effect from equal weighting.
  4. State the weighted parallel-trends condition in words: what untreated treated-control gaps must be equal after weighting?
  5. Why is a correctly calculated weighted DiD contrast not automatically a causal estimate?
Clinical Biostats