Originally posted by George Ford
View Post
I ran this and got these results:
Code:
gen t2treat = Year - _nfd
(552 missing values generated)
. egen controlmean = mean(cond(t2treat==.,OverallBalanceDeficit,.)), by(Year)
. tab _nfd
_nfd | Freq. Percent Cum.
------------+-----------------------------------
2013 | 146 23.32 23.32
2014 | 233 37.22 60.54
2015 | 47 7.51 68.05
2016 | 32 5.11 73.16
2017 | 71 11.34 84.50
2018 | 43 6.87 91.37
2019 | 54 8.63 100.00
------------+-----------------------------------
Total | 626 100.00
. foreach t in 2013 2014 2015 2016 2017 2018 2019 {
2. egen treatmean`t' = mean(cond(_nfd==`t',OverallBalanceDeficit,.)), by(Year)
3. g diffmean`t' = treatmean`t' - controlmean
4. }
.
. foreach t in 2013 2014 2015 2016 2017 2018 2019 {
2. twoway connected controlmean Year , sort || connected treatmean`t' Year , sort xline(`t') name(group`t', replace)
3. twoway connected diffmean`t' Year , sort xline(`t') name(group`t'_diff, replace)
4. }
.
end of do-file
2014:
lag10 contains very few observations so that's why you see the spike in the treatment there. It refers to 2013 treatment year. I might even drop it.

Comment