Tools › Statistics › Regression and Modeling › Difference-in-Differences and ITS › Example

When difference-in-differences misleads: a gap that was already growing before the change

ToolDifference-in-Differences and ITS
Sourceoriginal
LevelGraduate

Problem

Twelve treated and twelve comparison stores are followed for 8 months; the change applies from month 5. The treated stores were already gaining on the comparison stores by about 2 a month before the change, and nothing happens in month 5. Compute the estimate and the joint test of the gaps before the change.

Inputs to Enter

  • Rows: 192 seeded illustrative rows of unit, period, treated, outcome; first treated period 5
  • Standard errors: cluster-robust by unit; confidence level 95 %
Open the Difference-in-Differences and ITS tool

Answers

  • Means: treated 107.39 before and 118.92 after; comparison 103.30 before and 106.81 after; estimate 8.01
  • Cluster-robust: SE 0.485, t = 16.51 on 23 degrees of freedom, p < 0.0001, interval 7.01 to 9.02
  • Event study, reference month 4: gaps before the change −6.82, −5.17, −3.56; after it 1.38, 3.36, 4.26, 7.52: one steady climb through the change
  • Joint test that the three gaps before the change are zero: F(3, 23) = 22.94, p < 0.0001

Notes

Open this case in the tool: /analysis-tools/statistics/regression/difference-in-differences/?try=trends-not-parallel. The estimate of 8.01 with a narrow interval is the earlier drift carried into the after-period; the data were generated with no change at month 5. The event study shows it because there are several months before the change; with two periods nothing could. Seeded illustrative data, no real program, place or person; every figure is checked against an independent numpy and scipy computation. The estimate is a statistical association under the stated assumption, not a finding of cause.

More Examples for This Tool