Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Strange -xi- behavior when naming new variables
From
Jorge Eduardo Pérez Pérez <[email protected]>
To
<[email protected]>
Subject
st: Strange -xi- behavior when naming new variables
Date
Wed, 18 May 2011 00:08:20 -0400
Dear Statalist.
I have been getting strange results using -xi- in conjuction with -qreg-
I ran the following code to get some quantile regression estimates:
glo cont "personas_hogar edad edadsq"
glo cat "trabajo_permanente ocupacion actividad_empresa
tipo_trabajador sexo ultimo_grado_estudios"
glo ccat ""
foreach x in $cat {
glo ccat "$ccat i.`x'"
}
forv x=0.05(0.05)0.9501 {
xi: qreg lsalario_real_mes treatment i.area2 i.trimestre $cont $ccat
[fw=fex], nolog quantile(`x')
est save "cqte_c_fex_nob_`x'.ster", replace
}
The regression for quantile 0.75 did not converge and the loop ended
with a break, so I skipped that quantile, and reran the last loop
starting at the 0.8 quantile, i.e.
forv x=0.8(0.05)0.9501 { ....
At this point, -xi- changed the convention for naming the variables.
Since I saved the estimates, I got the command that was issued
everytime by typing:
glo a: dir . files "cqte_c_fex_nob_*"
foreach x in $a {
est use `x'
di "`x' ***********************************"
di ""
di e(cmdline)
di ""
}
And got:
cqte_c_fex_nob_.7000000000000001.ster ***********************************
qreg lsalario_real_mes treatment _Iarea2_* _Itrimestre_*
personas_hogar edad edadsq _Itrabajo_p_* _Iocupacion_* _
> Iactividad_* _Itipo_trab_* _Isexo_* _Iultimo_gr_* [fw=fex], nolog quantile(.7000000000000001)
cqte_c_fex_nob_.8.ster ***********************************
qreg lsalario_real_mes treatment _Iarea2_* _Itrimestre_*
personas_hogar edad edadsq _Itrabajo_p_* _Iocupaciona* _
> Iactividad_* _Itipo_trab_* _Isexo_* _Iultimo_gr_* [fw=fex], nolog quantile(.8)
Notice the difference between the two commands: _Iocupacion_* and
_Iocupaciona*_ !!!!
Is this something related to some variables left behind by -xi- when
the break occurred? Could this be a bug?
Thank you,
_______________________
Jorge Eduardo Pérez Pérez
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/