Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 37 ยท Instrumental Variables and DiD

Event Studies and Parallel Trends

Test the parallel trends assumption with an event study: estimate effects by period relative to treatment, read pre-trends, run placebo tests, and see what a violation looks like.

A single difference-in-differences number hides a lot. Did the effect appear immediately, grow slowly, or fade? Were the treated and control groups really moving together before the policy? An event study answers both questions by estimating one coefficient for every period relative to the treatment date.

The design

Define event time k = period - treatment_period. For the treated group k = -4, -3, ... 0, 1, 2 .... For each k estimate the gap between treated and control, measured against a reference period, usually k = -1 (the last period before treatment).

  • Coefficients for k < 0 are leads (pre-treatment). If parallel trends holds they should be near zero and show no trend.
  • Coefficients for k >= 0 are lags (post-treatment). They trace the dynamic effect.

When you plot the coefficients with confidence intervals, you get the classic event-study picture: a flat line before the vertical line at treatment, then a jump (or a ramp) afterward.

Python Event-study coefficients by hand

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The leads (k = -4 to -2) are close to zero with intervals that include zero. After treatment the estimates rise by about 1 per period, matching the dynamic effect we built in.

Differencing each unit against its own reference period removes the unit fixed effect, and comparing groups removes the shared trend. That is exactly what a two-way fixed-effects regression with event-time dummies does for a balanced panel with a common treatment date.

The scenario you fear: the treated group was already on a different path. Then the leads show a trend, and the post-period "effect" is partly just that trend continuing.

Python What a pre-trend violation looks like

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The leads climb steadily, the pre-period slope is clearly nonzero, and the plain DiD number overshoots the true effect of 2. The event study made a hidden problem visible.

Passing a pre-trends test does not prove parallel trends. Tests have low power, and the assumption concerns the post-treatment counterfactual, which you never see. Use pre-trends as evidence, not proof, and report sensitivity of the results (for example with the Rambachan and Roth bounds on how much the trends could deviate).

Placebo checks

Several falsification tests build confidence:

  • Placebo treatment date. Pretend treatment started earlier, using only pre-period data. The estimated effect should be zero.
  • Placebo outcome. Run the same design on an outcome the treatment should not affect.
  • Placebo group. Assign "treatment" to units that were never treated.
  • Different control groups. If results swing wildly depending on the control group, be careful.

Practical points

  1. Pick the reference period deliberately. It is normalized to zero by construction, so the lead at k = -1 can never show a problem.
  2. Bin the far ends. Combine very early and very late periods if few units are observed there.
  3. Anticipation. If people react before the official date (for example a policy announced in advance), leads at k = -1, -2 are nonzero even though trends are parallel. Shift the reference period back, or redefine event time at the announcement.
  4. Staggered timing. When units start treatment at different times, use estimators designed for that setting; the single-date code above is only valid for one common start date.
flowchart TD
    A["Estimate event-time coefficients"] --> B{"Leads near zero and flat?"}
    B -->|"Yes"| C["Parallel trends plausible: read the lags"]
    B -->|"No"| D["Revisit the control group, covariates or the design"]
    C --> E["Placebo and sensitivity checks"]

An event study is both the dynamic result and the main diagnostic.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In an event study, what should the pre-treatment coefficients look like if parallel trends holds?

    Before treatment the groups should move together, so gaps measured against the reference period should be near zero.
  2. 2. Why does the reference period (k = -1) show exactly zero?

    All other coefficients are measured relative to it, so it is zero by definition.
  3. 3. Passing a pre-trends test means:

    The assumption is about the unobserved post-treatment counterfactual, and pre-trend tests can have low power.
  4. 4. Which situation makes leads at k = -1 and -2 nonzero even when trends are parallel?

    If behavior changes in advance, the 'pre' periods are already affected.

Summary

  • An event study estimates one effect per period relative to treatment, against a reference period.
  • Leads test parallel trends; lags show the dynamics of the effect.
  • Visible pre-trends mean the plain DiD estimate is suspect.
  • Placebo dates, outcomes and groups strengthen (never prove) the design.
  • Watch for anticipation and for staggered treatment timing.

Next: Regression Discontinuity