2. Instruments and Panel Data

Panel Fixed Effects

Use within-unit variation while recognising time-varying confounding and limited support

Panel Fixed Effects

Panel data change the comparison

For unit ii and time tt,

Yit=τDit+αi+λt+εit.Y_{it}=\tau D_{it}+\alpha_i+\lambda_t+\varepsilon_{it}.
  • αi\alpha_i absorbs time-invariant unit differences;
  • λt\lambda_t absorbs shocks common to all units in a period;
  • τ\tau is estimated from within-unit treatment changes after common time changes are removed.

Units that never change DD do not directly identify τ\tau, although they can help estimate other components.

The within transformation

With unit fixed effects only, subtract each unit’s time mean:

YitYˉi=τ(DitDˉi)+(εitεˉi).Y_{it}-\bar Y_i=\tau(D_{it}-\bar D_i)+(\varepsilon_{it}-\bar\varepsilon_i).

The unobserved constant αi\alpha_i disappears. A permanent characteristic such as birthplace also disappears, so its coefficient cannot be separately estimated in the standard within regression.

For two-way fixed effects, subtract unit and time means and add the grand mean.

R

Compare pooled and two-way within slopes

Idle

The pooled slope mixes between-unit differences with within-unit change. The two-way transformation removes the constructed unit and period components; real data require a causal argument for the remaining change.

What fixed effects do not remove

ThreatExample
time-varying confoundinga local recession triggers policy and changes employment
anticipationfirms adjust before the clean-air zone starts
reverse causalityrising pollution accelerates policy adoption
measurement errordifferencing amplifies noisy treatment changes
dynamic responsecurrent outcome depends on past policy and past outcome
spilloverstraffic moves from treated to comparison municipalities

“Controls for all unit characteristics” means all time-invariant additive unit components in the specified model—not every unobserved factor.

Strict exogeneity is demanding

A standard fixed-effects argument often requires

E[εitDi1,,DiT,αi]=0.E[\varepsilon_{it}\mid D_{i1},\ldots,D_{iT},\alpha_i]=0.

Current shocks must not predict past or future treatment after conditioning. Policy adopted in response to an outcome shock can violate this condition even when unit fixed effects are present.

Variation and weighting audit

Report:

  • how many units switch treatment and when;
  • within versus between variation;
  • units lost because outcomes or treatment do not vary;
  • leverage of unusual switchers;
  • clustering and serial-correlation treatment;
  • whether the coefficient averages heterogeneous effects with problematic weights.

For causal interpretation of two-way fixed-effects regressions, Imai and Kim (2021) emphasise explicit counterfactual and treatment-history assumptions rather than a purely mechanical panel specification.

Quick check

A municipality’s policy changes once, immediately after a pollution spike. Do municipality and year fixed effects identify the policy effect?

Answer
Not automatically. The time-varying spike may both trigger adoption and predict future pollution. Fixed effects remove stable municipality differences and common year shocks, not this municipality-specific dynamic confounding.

Next: Dynamic Panels and Limits

Copyright © 2026