I'm working on ESS data and I want to graph the ESeC occupational class for all the 5 rounds I'm working on and for each country.
Therefore, I coded:
Code:
levelsof cntry, local(c) clean levelsof essround, local(r) foreach cntry in `c' { foreach essround in `r' { graph hbar (percent) if cntry=="`cntry'" & essround==`essround' [aw=dweight], over (esec) by(gndr, note("") title("Respondents ESeC Class")) ytitle("Percent", size(small)) blabel(bar, position(inside) format(%9.1f) color(white)) graph export "$path/graphs/`essround'_`cntry'.png", as(png) replace } }
After exporting the graphs for first country (AT) it returns
nothing to graph
Code:
levelsof cntry, local(c) clean levelsof essround, local(r) foreach cntry in `c' { foreach essround in `r' { keep if if cntry=="`cntry'" & essround==`essround' graph hbar (percent) [aw=dweight], over (esec) by(gndr, note("") title("Respondents ESeC Class")) ytitle("Percent", size(small)) blabel(bar, position(inside) format(%9.1f) color(white)) graph export "$path/graphs/`essround'_`cntry'.png", as(png) replace restore } }
Any suggestion?
Thank you
0 Response to Nothing to graph after loop
Post a Comment