Hi! I have panel data of mortality rate over time by state of the US as well as a dummy variable for an event that occurred in different states at different times. I was hoping to create line graphs for each state of this rate over time with vertical lines that indicate the event.
so far I have the following code:
twoway line (bipoc_rate year, by(state)), xline(2014, lcolor(red)) ytitle( Opioid Death per 100 000) title(year)
I would like the vertical line to occur when my variable mml equals 1.
Alternatively I could do:
twoway line bipoc_rate year if state==1, xline(2014, lcolor(red)) ytitle(Opioid Induced Death per 100 000) xtitle(Year)
But this would require me individually putting in the state and year that the event occurred.
Please let me know if this is possible or any advice, I am new to stata so anything helps.
Related Posts with twoway line graph with vertical lines that are conditional on third variable value
Problems with Estimation of Translog Cost Function and its derivative - Error Insufficient ObservationDear Statalist members, I am new to Stata and this is my first post. I want to estimate a translog…
Migration analysis using "Difference in difference "Dear All, I am looking to the impact of migration on sales. Suppose we have two cities, one receiv…
Position twoway labels in between two ticksHi, What do I have? A twoway graph with a line plot and an area plot. On the x-axis are dates (from…
Include void in a loopHello, I coded an optimization and I would like to repeat that optimization for subsamples randomly…
Compare regression coefficientsHi, I am interested in assessing the relationship between number of GP visits (IV) and wellbeing (D…
Subscribe to:
Post Comments (Atom)
0 Response to twoway line graph with vertical lines that are conditional on third variable value
Post a Comment