# Run difference-in-differences modeldid_model <-lm(outcome ~ treatment * post, data = data)# Summarize the outputmodelsummary(list(lm(outcome ~ treatment + post, data = data), lm(outcome ~ treatment * post, data = data)),estimate ="{estimate}{stars} ({std.error})",statistic =NULL,gof_omit ='IC|RMSE|Log|F|R2$|Std.')
Model 1
Model 2
(Intercept)
11.487*** (0.241)
12.078*** (0.265)
treatment
−0.604* (0.278)
−1.785*** (0.375)
post
−1.405*** (0.278)
−2.585*** (0.375)
treatment × post
2.361*** (0.531)
Num.Obs.
200
200
R2 Adj.
0.124
0.201
DiD: Assumptions
Treatment and control units would have changed in similar ways
Parallel trends
Requires at least 3 observation periods
Why can’t we just observe how units change over time?