BUT I WANT TO EDIT MY CURRENT CODE SO THAT FOR MULTIPLE GROUPS I CAN USE THE SAME REGRESSION TO PRODUCE THE GRAPH I'M GOING TO ATTACH IN THE COMMENT.
Code:
*** ssc install eventdd use "http://www.damianclarke.net/stata/bacon_example.dta", clear gen timeToTreat = year - _nfd eventdd asmrs pcinc asmrh cases i.year i.stfips, timevar(timeToTreat) method(ols, cluster(stfips)) *Then storing the estimates estimates store leads_lags #delimit ; coefplot leads_lags, keep(lead5 lead4 lead3 lead2 lead1 lag_0 lag1 lag2 lag3 lag4 lag5plus) vertical title( "{stSerif:{bf:Figure 1. {it:Trends in On-Premises Alcohol Licenses}}}", color(black) size(large)) xtitle("{stSerif:Years Since Law Came into Effect}") xscale(titlegap(2)) xline(6, lcolor(black)) yline(-.2 0 .2 .4 .6, lwidth(vvvthin) lpattern(dash) lcolor(black)) note("{stSerif:{it:Notes}. OLS coefficient estimates (and their 95% confidence intervals) are reported. The dependent}" "{stSerif:variable is equal to the number of on-premises liquor licences per 1,000 population in county {it:c}}" "{stSerif: and year {it:t}. The controls include year fixed effects and the data cover the period 1977-2011.}", margin(small)) graphregion(fcolor(white) lcolor(white) lwidth(vvvthin) ifcolor(white) ilcolor(white) ilwidth(vvvthin)) ciopts(lwidth(*3) lcolor(black)) mcolor(black) ; #delimit cr graph export "Anderson_Fig1_v1.png", as(png) replace
0 Response to Graph of event study for multiple regressions using eventdd package
Post a Comment