Hi all,
I am running the following regression"
reghdfe outcome beta1 gender2 race2, absorb(i.yearmonth i.hh_zip2)
Where beta1 is an interaction between pre/post an event and inside/outside of Pittsburgh. So, basically, this is like a difference in difference (twoway FE with yearmonth and household zipcode fixed effects, as certain zipcodes are in or outside of Pittsburgh). How would I run an event study of this? So far, I have done this but I am not sure it is quite right.
I am running the following regression"
reghdfe outcome beta1 gender2 race2, absorb(i.yearmonth i.hh_zip2)
Where beta1 is an interaction between pre/post an event and inside/outside of Pittsburgh. So, basically, this is like a difference in difference (twoway FE with yearmonth and household zipcode fixed effects, as certain zipcodes are in or outside of Pittsburgh). How would I run an event study of this? So far, I have done this but I am not sure it is quite right.
Code:
gen timevar1=0
gen timevar2=0
gen timevar3=0
gen timevar4=0
gen timevar5=0
gen timevar6=0
gen timevar7=0
gen timevar8=0
gen timevar9=0
replace timevar1=1 if activemonth_final==`=tm(2019m12)'
replace timevar2=1 if activemonth_final==`=tm(2020m1)'
replace timevar3=1 if activemonth_final==`=tm(2020m2)'
replace timevar4=1 if activemonth_final==`=tm(2020m3)'
replace timevar5=1 if activemonth_final==`=tm(2020m4)'
replace timevar6=1 if activemonth_final==`=tm(2020m5)'
replace timevar7=1 if activemonth_final==`=tm(2020m6)'
replace timevar8=1 if activemonth_final==`=tm(2020m7)'
replace timevar9=1 if activemonth_final==`=tm(2020m8)'
label var timevar1 "-3"
label var timevar2 "-2"
label var timevar3 "-1"
label var timevar4 "0"
label var timevar5 "1"
label var timevar6 "2"
label var timevar7 "3"
label var timevar8 "4"
label var timevar9 "5"
foreach v of varlist outcome {
reghdfe `v' timevar1 timevar2 o.timevar3 timevar4 timevar5 timevar6 timevar7 timevar8 timevar9, absorb(i.yearmonth i.hh_zip2)
coefplot, keep(timevar*) vertical title("`V'") xtitle("Months Since Event") ytitle("Coef.") omitted xline(5.5)
}

Comment