Could someone explain me what is wrong with my code below?
I do not know what happened. When I do the -collapse- for k==agua, it works:
Code:
. foreach k in agua sane rendm { 2. use censo_setor91_00_10_cep, clear 3. if `k'=="rendm" { 4. collapse (mean) C91`k' [aweight=C91chef], by(cep mun) 5. } 6. else { 7. collapse (mean) C91`k' [aweight=C91dompp], by(cep mun) 8. } 9. save censo_setor91_00_10_cep_col_`k'91, replace 10. } agua not found r(111); end of do-file r(111);
I do not know what happened. When I do the -collapse- for k==agua, it works:
Code:
. use censo_setor91_00_10_cep, clear . collapse (mean) C91agua [aweight=C91dompp], by(cep mun) . end of do-file