Hello,
I am having trouble with povdeco and/or levels7 in stata v. 9 - i suspect the latter. I have a dataset in which the dataset is classified by year and municipality, and I would like to generate municipal poverty rates for each year. However, when I run the program below, I get perfect results for the first year, then for each successive year the poverty rates for each municipality are far lower than they *should* be.
I'd be extremely grateful for your help.
Many thanks,
Pol
Stata code:
gen P0muni=.
gen P1muni=.
gen P2muni=.
local pline=pline
egen var=group(year muni)
levels7 var, local (S)
foreach r of local S {
povdeco iewb [w=expc], by(var) pl(`pline')
replace P0muni=r(fgt0_`r') if var == `r'
replace P1muni=r(fgt1_`r') if var == `r'
replace P2muni=r(fgt2_`r') if var == `r'
}
drop var
save, replace
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/