Announcement

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

  • Event Study Graph

    Hello!

    Im posting this because i need help with 2 things:

    1. I need to add a red yline() That takes the value of 0 from, -12 to 0 (x axsis). And then From 1 to 12, takes another value, for example lets say -0.04, that is the result form a regression coefficient (like a reference point on this graph)
    2. Wondering if i can add "shadow" soft gray, for the Confidence Interval of this reference point.

    **On the Photo is what I would like to graph.
    Click image for larger version

Name:	WhatsApp Image 2023-12-06 at 16.54.33.jpeg
Views:	2
Size:	41.7 KB
ID:	1736309




    Im using STATA /SE 18.0

    Here de DATA: https://drive.google.com/file/d/1oGz...ew?usp=sharing

    And here is the code:

    #delimit ;

    graph twoway (rcap max95 min95 EventYear, mcolor(black) lcolor(black) lpattern(solid))
    (scatter estimate EventYear, mcolor(black) lcolor(black) lpattern(solid) m(d) ),
    graphregion(fcolor(white) lcolor(white) lwidth(vvvthin) ifcolor(white) ilcolor(white) ilwidth(vvvthin))
    title( "{stSerif:{bf:Figure 1. {it:Event Study: `var'}}}", color(black) size(large))
    xtitle("{stSerif:Meses Desde el Derecto de Ley Migración}") xscale(titlegap(2))
    xline(0, lcolor(black) lpattern(dash)) legend(off)
    yline(0, lcolor(black) lpattern(dash))
    (rcap max95 min95 -0.01, mcolor(black) lcolor(black) lpattern(solid))
    xlabel(#17,valuelabel nogrid)
    (rcap)
    note("{stSerif:{it:Notes}. OLS coefficient estimates (and their 95% confidence intervals) are reported.}"
    "{stSerif: The controls include state and year fixed effects and the data cover the period from March 2021 to March 2023.}", margin(small)) ;

    #delimit cr


    ** On the this Photo, is what I have now:
    Click image for larger version

Name:	Screen Shot 2023-12-06 at 5.46.14 PM.png
Views:	1
Size:	67.4 KB
ID:	1736310


    Thanks!

  • #2
    Asked and answered at https://www.statalist.org/forums/for...-shadow-for-ic

    Comment

    Working...
    X