Hi all,
I have the following question for the code below. I am creating a new variable that is the mean of the variables below. I have the variables below labelled (for instance bhs_all_Act_ind1 has a varlabel of "Behavioral Health Services." Is there a way to make the mean of this variable have a label that is exactly the same so that when I do the twoway graph, the yaxis shows "Behavioral Health Services" instead of m7bhs_all_act_ind1? Thanks in advance. --CJ
I have the following question for the code below. I am creating a new variable that is the mean of the variables below. I have the variables below labelled (for instance bhs_all_Act_ind1 has a varlabel of "Behavioral Health Services." Is there a way to make the mean of this variable have a label that is exactly the same so that when I do the twoway graph, the yaxis shows "Behavioral Health Services" instead of m7bhs_all_act_ind1? Thanks in advance. --CJ
Code:
foreach v of varlist bhs_all_act_ind1 overdose hi_ed death_this_month { bys qdate: egen m7`v'=mean(`v') twoway line m7`v' qdate, xline(`=tq(2020q1)', lpattern(dash) lcolor(black)) legend(label(1 "No Children") label(2 "Children Ages 15-16") label(3 "Children Ages 17-18")) xtitle("Quarters") plotregion(color(none)) lcolor(gray) graph save "`v'april_da", replace graph export "`v'april_da.png", as (png) replace }
Comment