1 · The DiD idea
Why comparing one group's before/after change against a control group's change isolates a causal effect.
Treatment effects from before/after × treated/control, parallel trends, event studies.
Course overview
This free course uses real Python and statsmodels in your browser. Work through the modules below with explanations, executable examples, interactive controls, and questions.
Why comparing one group's before/after change against a control group's change isolates a causal effect.
The DiD estimate is exactly the interaction coefficient in a regression of y on treated, post, and their product.
DiD is valid only if the groups would have moved in parallel absent treatment; a pre-trend difference biases the ATT.
Estimate a separate effect for each period relative to treatment to test pre-trends and trace the effect's dynamics.