Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Running an event study

    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.

    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)
    }

  • #2
    I guess I am confused about how to get the event study right. Like, should I include beta1 in the event study---it seems to look weird either way and not like my coefficients off the original regression.

    Comment


    • #3
      gen interact1=city_pit*timevar1
      gen interact2=city_pit*timevar2
      gen interact3=city_pit*timevar3
      gen interact4=city_pit*timevar4
      gen interact5=city_pit*timevar5
      gen interact6=city_pit*timevar6
      gen interact7=city_pit*timevar7
      gen interact8=city_pit*timevar8
      gen interact9=city_pit*timevar9
      foreach v of varlist hous_all_act_ind hous_hmlss_svcs_act_ind inad_hous {
      reg `v' interact1 interact2 o.interact3 interact4 interact5 interact6 interact7 interact8 interact9
      coefplot, keep(interact*) vertical title("`V'") xtitle("Months Since Event") ytitle("Coef.") omitted xline(4.5) recast(connected) ciopts(recast(rcap))
      graph export "`v'event.png", as (png) replace
      }


      I have updated my code to the following, but it still doesn't look quite right ot me. I now made interaction variables between being in pittsbrugh (city_pit==1) and the timevariables and inclued them.

      Comment

      Working...
      X