Skip to content
Tools · Interactive

Difference-in-Differences Visualizer

See how a violation of parallel trends poisons the naive estimate, and how DiD recovers the truth.

Interactive · Figure Difference-in-Differences: in motion Drag the sliders to see how a violation of the parallel-trends assumption poisons the naive estimator.
TREATMENT Control Treated
Naive post-comparison +0.0 Treated − Control at the end
DiD estimate +0.0 Removes any common trend
Bias (naive − true) +0.0 What you would over-claim
How it works

What it computes

Two straight lines over ten periods, treatment at t = 5. Control follows 40 + 2.5t. Treated follows 42 + (2.5 + v/10)t, where v is the divergence slider; after t = 5 the same line continues plus the constant effect you set.

Naive estimate: treated minus control at t = 10. DiD estimate: the treated change from t = 5 to 10, minus the control change over the same window. The dashed line extends the treated pre-trend as the counterfactual.

Assumptions

  • A deliberately clean toy: linear trends, a constant additive effect, no noise, no anticipation.

Where it breaks

  • The naive gap is contaminated by the 2-point starting-level difference plus any trend divergence. DiD removes the level gap and the shared trend.
  • When pre-trends genuinely diverge (v ≠ 0), DiD keeps a residual bias of v/2 here, because the divergence keeps accruing over the five post periods. DiD cannot rescue a broken parallel-trends assumption; plot your pre-trends first.
  • No standard errors, no staggered adoption, no dynamic effects. Staggered rollouts need the modern DiD estimators.