How do i change the ytitle so it changes in every loop?
Thank you in advance!
This code gives me the variable names - I want to show the real names instead.
*HGB, Phoshourus, Calcium and vitamin D.
foreach x in "HGB" "fosfor" "ca" "D3_vit"{
regress `x' Total_CO2 AGE DATUM i.SEASON
twoway (lfit `x' Total_CO2, lcolor(black) lwidth(medthick)) || (lfit `x' Total_CO2 if SEX==0, lcolor(red) lpattern(dash)) || (lfit `x' Total_CO2 if SEX==1, lcolor(blue) lpattern(dash)), legend(label (1 "All") label (2 "Women") label (3 "Men")) xtitle("Dietary GHGE (kg/day)") ytitle(`x')
And this one is not correct.
foreach x in "HGB" "fosfor" "ca" "D3_vit"{
regress `x' Total_CO2 AGE DATUM i.SEASON
twoway (lfit `x' Total_CO2, lcolor(black) lwidth(medthick)) || (lfit `x' Total_CO2 if SEX==0, lcolor(red) lpattern(dash)) || (lfit `x' Total_CO2 if SEX==1, lcolor(blue) lpattern(dash)), legend(label (1 "All") label (2 "Women") label (3 "Men")) xtitle("Dietary GHGE (kg/day)") ytitle(order(1 "Hemoglobin" 2 Phoshourus 3 Calcium 4 Vitamin D))
Thank you in advance!
This code gives me the variable names - I want to show the real names instead.
*HGB, Phoshourus, Calcium and vitamin D.
foreach x in "HGB" "fosfor" "ca" "D3_vit"{
regress `x' Total_CO2 AGE DATUM i.SEASON
twoway (lfit `x' Total_CO2, lcolor(black) lwidth(medthick)) || (lfit `x' Total_CO2 if SEX==0, lcolor(red) lpattern(dash)) || (lfit `x' Total_CO2 if SEX==1, lcolor(blue) lpattern(dash)), legend(label (1 "All") label (2 "Women") label (3 "Men")) xtitle("Dietary GHGE (kg/day)") ytitle(`x')
And this one is not correct.
foreach x in "HGB" "fosfor" "ca" "D3_vit"{
regress `x' Total_CO2 AGE DATUM i.SEASON
twoway (lfit `x' Total_CO2, lcolor(black) lwidth(medthick)) || (lfit `x' Total_CO2 if SEX==0, lcolor(red) lpattern(dash)) || (lfit `x' Total_CO2 if SEX==1, lcolor(blue) lpattern(dash)), legend(label (1 "All") label (2 "Women") label (3 "Men")) xtitle("Dietary GHGE (kg/day)") ytitle(order(1 "Hemoglobin" 2 Phoshourus 3 Calcium 4 Vitamin D))
Comment