Hi everyone,
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
. I also tried with
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
}
}
But still after the AT, it seems like the restore doesn't work and all observation are canceled.
Any suggestion?
Thank you