Math for Causal Inference

Day 68. Parallel Trends & Event Studies

With several periods, an event-study regression traces effects period by period and puts the parallel-trends assumption on display through pre-treatment coefficients. Why pre-trend tests have low power, how anticipation shifts the reference period, and how to report results that are robust to bounded violations.

Video coming soon
Learning outcomes
  • ●Specify and interpret an event-study regression with unit and time fixed effects and a reference period.
  • ●Compute event-study coefficients from group-by-period means.
  • ●Calculate the power of a pre-trend test and explain why passing it is weak evidence.
  • ●Construct sensitivity intervals that allow post-treatment violations bounded by pre-treatment ones.
2-HOUR SESSION PLAN
Theory 25′Warm-up (1–5) 20′Proofs (6–10) 35′Applied (11–15) 25′Python & Lab 15′
Colab notebook (.ipynb) Jump to the simulator

Theory

The event-study regression

With one treated group adopting at date EE and many periods, define event time k=t−Ek = t - E. The event-study specification is

Yit=αi+λt+∑k≠−1βk 1[t−E=k] Gi+εit,Y_{it} = \alpha_i + \lambda_t + \sum_{k \ne -1}\beta_k\,\mathbf 1[t - E = k]\,G_i + \varepsilon_{it},

with unit fixed effects αi\alpha_i, period fixed effects λt\lambda_t, and the period just before treatment (k=−1k = -1) omitted as the reference. Each βk\beta_k is a DiD comparing period kk with period −1-1:

βk=(YˉG=1,k−YˉG=1,−1)−(YˉG=0,k−YˉG=0,−1).\beta_k = (\bar Y_{G=1, k} - \bar Y_{G=1, -1}) - (\bar Y_{G=0, k} - \bar Y_{G=0, -1}).
  • k≥0k \ge 0: dynamic treatment effects (ATT kk periods after adoption), under parallel trends.
  • k<0k < 0: placebo or pre-trend coefficients, zero if trends were parallel before treatment.

Flat pre-period coefficients are reassuring, but:

  1. Low power. Pre-trend coefficients are noisy; a violation large enough to matter can easily go undetected (Exercise 12).
  2. Pre-testing distortion. Reporting only studies that pass a pre-test selects samples where noise happened to hide the trend, which can increase bias (Roth, 2022).
  3. Parallel pre-trends do not guarantee parallel post-trends. The assumption is about the counterfactual after treatment.

Remedies and sensitivity

  • Group-specific linear trends: fit a line through the pre-period differences and extrapolate. Unbiased if the violation is exactly linear; can absorb part of a dynamic effect if not.
  • Bounded violations (Rambachan and Roth): assume the post-treatment deviation from parallel trends is at most MM times the largest pre-treatment deviation, and report the resulting interval for each MM, plus the breakdown value of MM at which the effect is no longer significant.
  • Conditional parallel trends: assume parallel trends only among units with the same pre-treatment covariates; estimate with regression, weighting or doubly robust DiD.

Anticipation

If behaviour changes one period before adoption, the coefficient at k=−1k = -1 is already affected. Use k=−2k = -2 (or earlier) as the reference.

Part 1 · Warm-up

Exercise 1 · Reading coefficients

An event study reports β^−3=0.1\hat\beta_{-3} = 0.1, β^−2=−0.05\hat\beta_{-2} = -0.05, β^0=1.2\hat\beta_0 = 1.2, β^1=1.8\hat\beta_1 = 1.8, β^2=2.1\hat\beta_2 = 2.1 (SEs around 0.2). Describe the results.

Show solution

Step 1. Pre-period coefficients are small and insignificant: no visible pre-trend.

Step 2. The effect appears on impact (1.2) and grows over two years (2.1).

Answer: a dynamic effect that builds over time, with parallel pre-trends as supporting (not conclusive) evidence.

Exercise 2 · The reference period

Why must one event-time indicator be omitted, and what does choosing k=−1k = -1 mean?

Show solution

Step 1. With unit and time fixed effects, the full set of event-time dummies for the treated group is collinear with the unit fixed effect.

Step 2. Omitting k=−1k = -1 measures every βk\beta_k relative to the last pre-treatment period.

Answer: all coefficients are DiDs relative to period −1, which is zero by construction.

Exercise 3 · Coefficients from means

Treated means in periods −3, −2, −1, 0, 1: 10, 11, 12, 16, 17. Comparison: 8, 9, 10, 11, 12. Compute β−3,β−2,β0,β1\beta_{-3}, \beta_{-2}, \beta_0, \beta_1.

Show solution

Step 1. β−3=(10−12)−(8−10)=0\beta_{-3} = (10 - 12) - (8 - 10) = 0; β−2=(11−12)−(9−10)=0\beta_{-2} = (11 - 12) - (9 - 10) = 0.

Step 2. β0=(16−12)−(11−10)=3\beta_0 = (16 - 12) - (11 - 10) = 3.

Step 3. β1=(17−12)−(12−10)=3\beta_1 = (17 - 12) - (12 - 10) = 3.

Answer: no pre-trend, a constant effect of 3.

Exercise 4 · Linear extrapolation

Pre-period coefficients are β−3=−0.6\beta_{-3} = -0.6, β−2=−0.3\beta_{-2} = -0.3 (and β−1=0\beta_{-1} = 0): a linear trend of +0.3 per period. If β^2=1.5\hat\beta_2 = 1.5, what is the trend-adjusted effect at k=2k = 2?

Show solution

Step 1. Extrapolated violation at k=2k = 2: 0.3×2=0.60.3 \times 2 = 0.6.

Step 2. Adjusted: 1.5−0.6=0.91.5 - 0.6 = 0.9.

Exercise 5 · Joint versus individual tests

Why test pre-period coefficients jointly rather than one at a time?

Show solution

Step 1. With several pre-periods, one coefficient may be significant by chance (multiple testing), while several small same-sign coefficients may each be insignificant yet jointly informative.

Answer: a joint F (Wald) test uses all pre-period information at once with correct size.

Part 2 · Proofs

Exercise 6 · Event-study coefficients identify dynamic ATTs

With one treated and one comparison group, balanced data and the saturated event-study regression, prove β^k\hat\beta_k equals the DiD of means between periods kk and −1-1, and that under parallel trends and no anticipation it is unbiased for ATTkATT_k (k≥0k \ge 0) and for 0 (k<0k < 0).

Show solution

Step 1. The regression has one parameter per group-period cell (unit effects absorb group levels, period effects the comparison path, βk\beta_k the treated deviations); it is saturated in group × period means.

Step 2. So fitted cell means equal sample cell means, and β^k\hat\beta_k is the treated-minus-comparison change from period −1-1 to kk.

Step 3. By Day 67, Exercise 9, its expectation is ATTk+ΔkATT_k + \Delta_k, where Δk\Delta_k is the difference in untreated trends between −1-1 and kk; under parallel trends Δk=0\Delta_k = 0.

Step 4. For k<0k < 0 the ATT is 0 (no anticipation), so E[β^k]=0E[\hat\beta_k] = 0. ■\blacksquare

Exercise 7 · Linear trend adjustment

Suppose the violation is linear: Δk=s (k+1)\Delta_k = s\,(k + 1) for all kk. Show that β^k−s^(k+1)\hat\beta_k - \hat s(k + 1), with s^\hat s fitted on pre-periods, is unbiased for ATTkATT_k.

Show solution

Step 1. Pre-period coefficients have expectation s(k+1)s(k + 1), so a least-squares slope through them (and the origin at k=−1k = -1) is unbiased for ss.

Step 2. E[β^k]=ATTk+s(k+1)E[\hat\beta_k] = ATT_k + s(k + 1) for k≥0k \ge 0.

Step 3. Subtract E[s^](k+1)=s(k+1)E[\hat s](k + 1) = s(k + 1). ■\blacksquare If the violation is not linear, the adjustment is biased.

Exercise 8 · Power of a pre-trend test

A pre-period coefficient has expectation μ\mu and standard error σ\sigma (normal). Show the power of a two-sided 5% test is Φ(−1.96−μ/σ)+1−Φ(1.96−μ/σ)\Phi(-1.96 - \mu/\sigma) + 1 - \Phi(1.96 - \mu/\sigma).

Show solution

Step 1. The t-statistic is N(μ/σ,1)N(\mu/\sigma, 1).

Step 2. Rejection: ∣t∣>1.96|t| > 1.96.

Step 3. P(t>1.96)=1−Φ(1.96−μ/σ)P(t > 1.96) = 1 - \Phi(1.96 - \mu/\sigma) and P(t<−1.96)=Φ(−1.96−μ/σ)P(t < -1.96) = \Phi(-1.96 - \mu/\sigma). Add. ■\blacksquare

Exercise 9 · Bounded violations

Assume the post-period violation satisfies ∣Δpost∣≤MΔˉpre|\Delta_{post}| \le M\bar\Delta_{pre}, where Δˉpre\bar\Delta_{pre} is the largest absolute pre-period deviation (treated as known). Show that ATT∈[β^−MΔˉpre,  β^+MΔˉpre]ATT \in [\hat\beta - M\bar\Delta_{pre},\; \hat\beta + M\bar\Delta_{pre}] in population, and give a 95% version.

Show solution

Step 1. β=ATT+Δpost\beta = ATT + \Delta_{post}, so ATT=β−ΔpostATT = \beta - \Delta_{post}.

Step 2. With Δpost∈[−MΔˉpre,MΔˉpre]\Delta_{post} \in [-M\bar\Delta_{pre}, M\bar\Delta_{pre}], ATT∈[β−MΔˉpre,β+MΔˉpre]ATT \in [\beta - M\bar\Delta_{pre}, \beta + M\bar\Delta_{pre}].

Step 3. Accounting for sampling error in β^\hat\beta: [β^−MΔˉpre−1.96 SE⁡,  β^+MΔˉpre+1.96 SE⁡][\hat\beta - M\bar\Delta_{pre} - 1.96\,\operatorname{SE},\; \hat\beta + M\bar\Delta_{pre} + 1.96\,\operatorname{SE}] covers the ATT with probability at least 95%. ■\blacksquare

Exercise 10 · Anticipation and the reference period

Suppose units react one period early, so E[β^−1]E[\hat\beta_{-1}] would be a≠0a \ne 0 if it were estimated. Show that normalising β−1=0\beta_{-1} = 0 shifts every other coefficient by −a-a, and that using k=−2k = -2 as the reference removes the bias.

Show solution

Step 1. Each β^k\hat\beta_k is a DiD relative to period −1: E[β^k]=(ATTk+Δk)−(a+Δ−1)E[\hat\beta_k] = (ATT_k + \Delta_k) - (a + \Delta_{-1}); with parallel trends Δ=0\Delta = 0, it is ATTk−aATT_k - a.

Step 2. With k=−2k = -2 as reference (no anticipation there), E[β^k]=ATTkE[\hat\beta_k] = ATT_k, and the coefficient at k=−1k = -1 estimates aa. ■\blacksquare

Part 3 · Applied

Exercise 11 · State minimum wage and teen employment

Teen employment rates (%) in a state that raised its minimum wage in period 0, periods −3 to 2: 30.0, 30.5, 31.0, 30.0, 29.5, 29.3. In comparison states: 32.0, 32.4, 32.9, 33.2, 33.5, 33.7. Compute the event-study coefficients (reference −1).

Show solution

Step 1. β−3=(30.0−31.0)−(32.0−32.9)=−1.0+0.9=−0.1\beta_{-3} = (30.0 - 31.0) - (32.0 - 32.9) = -1.0 + 0.9 = -0.1.

Step 2. β−2=(30.5−31.0)−(32.4−32.9)=−0.5+0.5=0\beta_{-2} = (30.5 - 31.0) - (32.4 - 32.9) = -0.5 + 0.5 = 0.

Step 3. β0=(30.0−31.0)−(33.2−32.9)=−1.3\beta_0 = (30.0 - 31.0) - (33.2 - 32.9) = -1.3.

Step 4. β1=(29.5−31.0)−(33.5−32.9)=−2.1\beta_1 = (29.5 - 31.0) - (33.5 - 32.9) = -2.1; β2=(29.3−31.0)−(33.7−32.9)=−2.5\beta_2 = (29.3 - 31.0) - (33.7 - 32.9) = -2.5.

Answer: flat pre-trends and a growing employment decline of 1.3 to 2.5 points.

Exercise 12 · How likely is a pre-test to catch a trend?

In a study of hospital mergers on prices, a linear violation would make E[β^−3]=−0.9E[\hat\beta_{-3}] = -0.9 (percent), with SE 0.5. What is the probability the pre-trend test at k=−3k = -3 rejects?

Show solution

Step 1. μ/σ=−1.8\mu/\sigma = -1.8.

Step 2. Power =Φ(−1.96+1.8)+1−Φ(1.96+1.8)=Φ(−0.16)+1−Φ(3.76)≈0.436+0.000=0.44= \Phi(-1.96 + 1.8) + 1 - \Phi(1.96 + 1.8) = \Phi(-0.16) + 1 - \Phi(3.76) \approx 0.436 + 0.000 = 0.44.

Answer: about 44%: more often than not, this sizeable trend goes undetected.

Exercise 13 · Sensitivity for a paid-leave mandate

A paid-family-leave mandate raises mothers' employment by β^=2.0\hat\beta = 2.0 points (SE 0.5) one year after; the largest pre-period deviation is 0.4. Compute the 95% sensitivity intervals for M=1M = 1 and M=2M = 2, and the breakdown value of MM.

Show solution

Step 1. M=1M = 1: [2.0−0.4−0.98,  2.0+0.4+0.98]=[0.62,3.38][2.0 - 0.4 - 0.98,\; 2.0 + 0.4 + 0.98] = [0.62, 3.38].

Step 2. M=2M = 2: [2.0−0.8−0.98,  2.0+0.8+0.98]=[0.22,3.78][2.0 - 0.8 - 0.98,\; 2.0 + 0.8 + 0.98] = [0.22, 3.78].

Step 3. Breakdown: lower bound 2.0−0.4M−0.98=0⇒M=1.02/0.4=2.552.0 - 0.4M - 0.98 = 0 \Rightarrow M = 1.02/0.4 = 2.55.

Answer: the effect stays positive unless post-period violations are more than 2.5 times the largest pre-period one.

Exercise 14 · Anticipation in hospital mergers

Hospitals announce a merger a year before it closes and start renegotiating contracts. An event study normalised at k=−1k = -1 shows β^0=3%\hat\beta_0 = 3\% and β^−2=−2%\hat\beta_{-2} = -2\%. Reinterpret with k=−2k = -2 as the reference.

Show solution

Step 1. Re-normalising to k=−2k = -2 adds 2 points to every coefficient: β−1=2%\beta_{-1} = 2\% (anticipation effect), β0=5%\beta_0 = 5\%.

Answer: prices rose 2% already after the announcement and 5% by closing; the original normalisation understated the effect.

States that expanded Medicaid had lower baseline uninsured rates, and uninsured rates predict mortality trends. How can covariates restore parallel trends, and what is assumed?

Show solution

Step 1. Assume parallel trends conditional on baseline covariates XX (uninsured rate, income, age structure): E[ΔY(0)∣G=1,X]=E[ΔY(0)∣G=0,X]E[\Delta Y(0) \mid G = 1, X] = E[\Delta Y(0) \mid G = 0, X].

Step 2. Estimate by comparing changes within XX cells, by outcome regression of ΔY\Delta Y on XX in comparison states, or by doubly robust DiD (propensity weighting plus outcome regression).

Step 3. Use only pre-treatment covariates: post-treatment ones may be affected by the expansion (Day 53).

Answer: conditional parallel trends plus overlap in XX.

Verify in Python

import numpy as np
from scipy.stats import norm

def es(T, C, ref):
    """Event-study coefficients from treated and comparison means; ref = index of period -1."""
    return np.round([(T[k] - T[ref]) - (C[k] - C[ref]) for k in range(len(T))], 3)
print("Ex 3:", es([10, 11, 12, 16, 17], [8, 9, 10, 11, 12], 2))
print("Ex 11:", es([30, 30.5, 31, 30, 29.5, 29.3], [32, 32.4, 32.9, 33.2, 33.5, 33.7], 2))
m = -.9 / .5
print("pre-test power:", round(norm.cdf(-1.96 - m) + 1 - norm.cdf(1.96 - m), 3))
for M in (1, 2):
    print(f"M={M}: [{2 - .4 * M - .98:.2f}, {2 + .4 * M + .98:.2f}]", end="  ")
print("breakdown M:", round((2 - .98) / .4, 2))

# Event-study regression with unit and time fixed effects on a simulated panel (linear pre-trend 0.3)
rng = np.random.default_rng(68)
N, Tn, E = 200, 8, 5
G = (np.arange(N) < N // 2).astype(float)
t = np.arange(Tn); k = t - E
Y = (rng.normal(0, 2, N)[:, None] + 0.5 * t[None, :] + 0.3 * k[None, :] * G[:, None]
     + G[:, None] * np.where(k >= 0, 1 + 0.5 * k, 0)[None, :] + rng.normal(0, 1, (N, Tn)))
rows = []
for i in range(N):
    for s in range(Tn):
        r = [1.0] + [float(i == j) for j in range(1, N)] + [float(s == q) for q in range(1, Tn)]
        r += [G[i] * float(k[s] == kk) for kk in range(-E, Tn - E) if kk != -1]
        rows.append(r)
b = np.linalg.lstsq(np.array(rows), Y.ravel(), rcond=None)[0][-(Tn - 1):]
labels = [kk for kk in range(-E, Tn - E) if kk != -1]
print("event-study betas:", {kk: round(float(v), 2) for kk, v in zip(labels, b)})
print("truth (effect + 0.3*(k+1) trend):", {kk: round((1 + .5 * kk if kk >= 0 else 0) + .3 * (kk + 1), 2) for kk in labels})

Key takeaways

  • Event-study coefficients are DiDs relative to a reference period; pre-period coefficients test for diverging trends before treatment.
  • Pre-trend tests have limited power, and passing them does not establish parallel trends after treatment.
  • Report sensitivity to bounded violations (and the breakdown value), re-normalise if there is anticipation, and use conditional parallel trends when observable differences predict trends.

Simulation Lab: Event Studies & Pre-Trends

Open full screen →

Event-study coefficients with pre-trends, anticipation and a sensitivity interval for bounded violations.

02-5-4-3-2-101234event time kcoefficient
β at k = 2
1.95
true effect 2.00
sensitivity interval (M = 1)
[0.92, 2.98]

Event-study coefficients (dots, with 95% intervals) are DiDs relative to the reference period. Grey squares show the true effect plus any pre-existing trend gap. Add a linear pre-trend, anticipation or noise and see what the pre-period coefficients reveal, and how a sensitivity interval that allows post-period violations up to M times the largest pre-period one changes the conclusion at k = 2.

Day 67Day 69