Tools › Statistics › Regression and Modeling › Difference-in-Differences and ITS › Example
Difference-in-differences on 14 clinics: an estimate that classical errors call clear and clustered errors do not
| Tool | Difference-in-Differences and ITS |
| Source | original |
| Level | Graduate |
Problem
Six clinics adopt a new scheduling system from quarter 7; eight do not. Visits per clinic are recorded for 10 quarters (140 rows). Estimate the difference-in-differences and compare its classical, heteroskedasticity-robust (HC1) and cluster-robust (by clinic) standard errors.
Inputs to Enter
- Rows: 140 seeded illustrative rows of unit, period, treated, outcome (the default case of the tool); first treated period 7
- Standard errors: cluster-robust by unit; confidence level 95 %; no covariates
Answers
- Means: treated 62.20 before and 67.29 after; comparison 61.62 before and 61.85 after
- Estimate = (67.29 − 62.20) − (61.85 − 61.62) = 4.86; counterfactual treated level after = 62.43, so the estimate is 7.8 % of it
- Classical: SE 1.767, t = 2.75 on 136 degrees of freedom, p = 0.0067, interval 1.37 to 8.36
- HC1: SE 2.100, p = 0.0221, interval 0.71 to 9.01
- Cluster-robust (CR1, 14 clinics): SE 3.384, t = 1.44 on 13 degrees of freedom, p = 0.1744, interval −2.45 to 12.17
- Event study, reference quarter 6: gaps before the change between −0.86 and 0.61, joint test F(5, 13) = 0.36, p = 0.8689; gaps after the change 4.73, 4.32, 4.60, 5.64
Notes
The default inputs of the tool are this case; press Submit, or open /analysis-tools/statistics/regression/difference-in-differences/?try=fades-when-clustered. Each clinic was given its own lasting shift after quarter 7 and no common effect, so the rows of one clinic move together; the clustered error is 1.91 times the classical one. 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
- Difference-in-differences on 20 stores over 8 months: estimate, clustered interval and event study
- When difference-in-differences misleads: a gap that was already growing before the change
- Interrupted time series of 48 months: a level drop with no change of slope, Newey-West errors
- Interrupted time series: no jump at the intervention, the trend bends
- Difference-in-differences from a published two-by-two table: four means, standard deviations and counts