Announcement

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

  • Event Study for Continuous Treatment

    I am trying to conduct an event study for my project. However, every code that I have tried to use gives me the graph with 0 coefficient being at the bottom of the y axis and therefore all of my coefficiets lay in a straight line at the bottom of the graph. I am not sure how to fix this.

    This is the code that I am using:
    reghdfe lnPrice DistxY2003 DistxY2004 DistxY2005 DistxY2006 DistxY2007 DistxY2008 DistxY2010 DistxY2011 DistxY2012 DistxY2013 DistxY2014 DistxY2015, a(postcode Year) vce(clustered postcode)

    parmest, label for(estimate min95 max95) li(parm label estimate min95 max95) saving(EventStudy.dta, replace)


    use EventStudy,clear

    gen time = .
    replace time = -8 if parm == "DistxY2002"
    replace time = -7 if parm == "DistxY2003"
    replace time = -6 if parm == "DistxY2004"
    replace time = -5 if parm == "DistxY2005"
    replace time = -4 if parm == "DistxY2006"
    replace time = -3 if parm == "DistxY2007"
    replace time = -2 if parm == "DistxY2008"
    replace time = -1 if parm == "DistxY2009"
    replace time = 0 if parm == "DistxY2010"
    replace time = 1 if parm == "DistxY2011"
    replace time = 2 if parm == "DistxY2012"
    replace time = 3 if parm == "DistxY2013"
    replace time = 4 if parm == "DistxY2014"
    replace time = 5 if parm == "DistxY2015"

    twoway rcap min max time, color(gs7)|| scatter est time, yline(0,lp(dash)) ytitle("Coefficients and 95% CI") xlabel(-7(1)5) xtitle("Year") leg(off) yscale(noline)

    (Below is the graph that I consistently keep getting)
    Last edited by maria filatenko; 27 Mar 2023, 10:51.

  • #2
    Click image for larger version

Name:	image_30564.png
Views:	1
Size:	84.3 KB
ID:	1707330 Event Study Graph:
    Last edited by maria filatenko; 27 Mar 2023, 11:12.

    Comment

    Working...
    X