Math for Causal Inference
All simulators

Two-Way Fixed Effects

Raw, unit-demeaned and two-way-demeaned panels: pooled OLS, one-way FE and TWFE compared.

Day 69: Two-Way Fixed Effects & Panel Algebra
101502468yearlog wage (×10)
pooled OLS
4.66
unit FE only
3.11
two-way FE
1.41
truth
1.00
join the union in year 5never join

Eight workers over ten years. The four with the highest permanent wage level (unit effect) join a union in year 5. Pooled OLS confuses permanent differences with the union effect; removing unit means (one-way FE) leaves the common time trend tangled with the treatment timing; removing unit and year means (TWFE) isolates within-unit changes.