A step-by-step general guide for studying the effect of a policy with difference-in-differences: get the data ready, pick an estimator that fits your design, then check the results before you report them.
By Oscar Torres-Reyna and Claude Opus 5.5 Medium.
Work through these before running any model. The answers in "Treatment pattern" feed directly into the decision tree in Step 2. Your ticks are saved in this browser only.
This is a general guide, double-check with your advisor. Answer each question about your design. The tree ends with a recommended estimator, Stata and R code, and the main things to watch out for. Click "Change" on any earlier answer to explore another branch.
flowchart TD
A{"Binary treatment?"} -->|No| R1["Dose or intensity:
did_multiplegt_dyn, contdid"]
A -->|Yes| B{"Stays treated once treated?"}
B -->|"No, switches off"| R2["Switching treatment:
did_multiplegt_dyn"]
B -->|Yes| C{"Third comparison group
within units?"}
C -->|Yes| R3["Triple differences:
didregress with two groups, triplediff"]
C -->|No| D{"How many treated units?"}
D -->|"A handful"| R4["Few treated units:
sdid, wild bootstrap"]
D -->|Many| E{"Common treatment date?"}
E -->|Yes| F{"Only two periods?"}
F -->|Yes| R5["Canonical 2x2:
xtdidregress, drdid"]
F -->|No| R6["Common timing:
TWFE event study is valid"]
E -->|"No, staggered"| G{"Never-treated units?"}
G -->|"Yes or no: sets the control group"| H{"Count or binary outcome,
proportional effects?"}
H -->|Yes| R7["Poisson ETWFE:
jwdid method poisson, etwfe"]
H -->|No| I{"Covariates needed for
parallel trends?"}
I -->|Yes| R8["Doubly robust:
csdid dripw, xthdidregress aipw"]
I -->|No| R9["Robust staggered DiD:
csdid + jwdid or did_imputation"]
A single coefficient is not a finding. Before you report, make sure the estimate survives these checks, and say in words what was averaged and against which comparison group.