Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65553

foreach error 111

$
0
0
Could someone explain me what is wrong with my code below?

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

Viewing all articles
Browse latest Browse all 65553

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>