I have a dataset containing values for different sector. The variable describing the sector (settore) has "value" from 1 to 5 and "value label" describing the sector ("Agricoltura" "Costruzioni" "Industria" "Servizi" "Totale Economia").
I want to produce the 5 graphs with a "foreach" or "forvalue" loop, with each title corresponding to the "value label" as well as saving with the name of the sector.
The code:
Works well in producing the 5 graphs, but puts the title and the name as "value" (1 to 5) not "value label".
How can I retrive the "value label" with a code like this?
Thanks,
M
I want to produce the 5 graphs with a "foreach" or "forvalue" loop, with each title corresponding to the "value label" as well as saving with the name of the sector.
The code:
Code:
forvalues i=1(1)5 {
twoway bar DLVA_lavva DLVA_capva DLVA_dltfp anno if settore==`i', barwidth(0.7 0.7 0.7) || line dlva anno if settore==`i', ///
yaxis(2) xlabel(1996(2)2022) ytitle("", axis(2)) legend(pos(6) row(2)) title(`i')
graph save "Graph" "Graph_`i'.gph", replace
How can I retrive the "value label" with a code like this?
Thanks,
M

Comment