Hi, I want to run a regression for each of the 19 "localidades" located in the variable COD_LOCALIDAD.
foreach localidad in COD_LOCALIDAD {
reg ln_PERCAPITA ethnici1 edumo2 edumo3 edufa2 edufa3 female birthreg2 birthreg3 [iw=FEX_C] if FG==1 & COD_LOCALIDAD == `localidad'
est sto ols_`localidad'
}
The problem with that line of code is that I am only getting one regression, instead of 19. ¿ What am I missing?
foreach localidad in COD_LOCALIDAD {
reg ln_PERCAPITA ethnici1 edumo2 edumo3 edufa2 edufa3 female birthreg2 birthreg3 [iw=FEX_C] if FG==1 & COD_LOCALIDAD == `localidad'
est sto ols_`localidad'
}
The problem with that line of code is that I am only getting one regression, instead of 19. ¿ What am I missing?
Comment