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
Quicker way to export correlation coefficients into Excel?Hello, I am running correlations over hundreds of variables and storing the output of the correlatio…
Wald chi2 disappears after I apply the robust variance estimateDear Stata users and experts, I am running an analysis where I have a time invariant variable, cross…
Help with output/results window cutting off variable namesMy variable names are not shown in full, is there any way of getting Stata to tabulate so the output…
New command -oaxaca_rif-Dear all, Thanks to Prof. Baum a new command named oaxaca_rif is now available in the SSC archive. T…
Reporting results ordered logit regression: individual predictors or entire model?Hello, I am running the ordered logit regression to predict eh041, by regression on the variables a…
Subscribe to:
Post Comments (Atom)
0 Response to twoway line graph with vertical lines that are conditional on third variable value
Post a Comment