I am creating graphs from survey variables and use foreach to replicate the graphs over many variables. I would like to separate the graphs using subtitles with the variable labels. My script now have `var' as subtitle, and I plan to use the Graph Editor to change the subtitles from `var' to `var' label. But, I hope there is a way I can call the `var' label instead of the `var' name in the subtitle, so that I do not need to edit all the graphs. Hope someone has a fix for this.
Best,
Frode
Code:
foreach var of varlist new0q32N1-new0q32N12 {
graph bar [aweight = utvalgsvekt], over(`var', label(angle(forty_five) labsize(small))) nofill blabel(bar, size(small) format(%9.2f)) ytitle("Prosent" " ") ytitle(, size(small)) yscale(range(0 70)) ylabel(, labels labsize(small) angle(horizontal) noticks) by(, title("Hvor positiv eller negativ er du til følgende tiltak? " " ", size(medium)) caption(, size(vsmall)) subtitle(`var', size(small))) name(`var'Alder, replace) by(AlderFordeling) subtitle(, size(small))
}
Frode

Comment