Difference-in-Differences (DID)
DID is a causal inference method that estimates the effect of an intervention/policy by comparing the change over time between a treatment group and a control group. The idea: the difference of the before–after differences between the two groups is the policy effect, provided the two groups would have followed parallel trends absent the intervention.
In EcoLab, DID belongs to the Causal Inference group. See Estimation & Modeling.
When should you use DID?
- There is a shock/policy applied to one group at a point in time, while another group is not.
- You have data before and after the intervention for both groups (panel or repeated cross-sections).
- The parallel trends assumption is plausible (testable via pre-trends).
Model specification
Two-group, two-period DID form: