Hello, I am trying to generate an event study graph after running DID regression. My data is a repeated cross-section. The treatment is given all at once in year 2018.
-outcome- variable is the outcome of interest. -rec_treat- identifies the group that receives treatment. -rec_treat*year- is the interaction term (= 1 if received treatment and year>=2018).
The sample data is given below:
I am using -reghdfe- to run the DD regression and -coefplot- (ssc install ftools) for the event study graph. Please help in generating this.
-outcome- variable is the outcome of interest. -rec_treat- identifies the group that receives treatment. -rec_treat*year- is the interaction term (= 1 if received treatment and year>=2018).
The sample data is given below:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int(district_code outcome) float(rec_treat year rec_treat*year) 1 8 1 2011 0 1 . 1 2014 0 1 . 1 2013 0 1 42 1 2012 0 1 33 1 2013 0 1 22 1 2012 0 1 22 1 2014 0 1 11 1 2011 0 1 14 1 2011 0 1 3 1 2014 0 1 17 1 2012 0 1 6 1 2014 0 1 18 1 2011 0 1 4 1 2013 0 1 29 1 2014 0 1 6 1 2014 0 1 14 1 2011 0 1 37 1 2011 0 1 19 1 2010 0 1 10 1 2011 0 1 16 1 2010 0 1 11 1 2012 0 1 14 1 2012 0 1 28 1 2010 0 1 25 1 2011 0 1 25 1 2010 0 1 . 1 2014 0 1 23 1 2014 0 1 19 1 2011 0 1 41 1 2011 0 1 26 1 2012 0 1 5 1 2014 0 1 25 1 2010 0 1 9 1 2014 0 1 11 1 2012 0 1 26 1 2014 0 1 5 1 2014 0 1 4 1 2014 0 1 7 1 2010 0 1 29 1 2010 0 1 5 1 2012 0 1 . 1 2014 0 1 9 1 2012 0 1 65 1 2011 0 1 21 1 2011 0 1 34 1 2014 0 1 11 1 2010 0 1 9 1 2014 0 1 20 1 2011 0 1 14 1 2012 0 551 6 1 2022 1 551 12 1 2018 1 551 7 1 2018 1 551 7 1 2022 1 551 8 1 2018 1 551 . 1 2022 1 551 . 1 2022 1 551 6 1 2022 1 551 5 1 2018 1 551 29 1 2018 1 551 24 1 2018 1 551 11 1 2022 1 544 2 1 2022 1 544 8 1 2022 1 544 9 1 2022 1 544 6 1 2018 1 544 9 1 2022 1 544 7 1 2018 1 544 16 1 2022 1 544 12 1 2022 1 544 . 1 2018 1 544 17 1 2018 1 544 3 1 2018 1 544 21 1 2018 1 544 1 1 2022 1 544 17 1 2018 1 544 3 1 2022 1 544 22 1 2022 1 544 10 1 2022 1 544 17 1 2018 1 544 . 1 2022 1 544 14 1 2018 1 544 10 1 2018 1 544 8 1 2018 1 544 11 1 2018 1 544 9 1 2018 1 544 13 1 2018 1 544 26 1 2018 1 544 6 1 2022 1 544 3 1 2018 1 544 7 1 2022 1 544 5 1 2022 1 544 24 1 2018 1 544 9 1 2018 1 544 8 1 2022 1 544 6 1 2022 1 544 6 1 2022 1 544 18 1 2022 1 544 . 1 2018 1 544 10 1 2022 1 544 . 1 2018 1 544 10 1 2022 1 544 19 1 2018 1 544 1 1 2022 1 end
Comment