Hi, I got a do file that only label variables and I need to use it by running it inside another 2 do files which are basically the same but one has variables from 1996 and the other one from 2010. So I tried using this:
foreach x in 96 10{
cap label var ind1_`x' "Nro docentes /Nro alumnos pregrado v.0"
cap label var ind1_`x'_1 "Nro docentes /Nro alumnos pregrado v.1"
cap label var ind1_`x'_2 "Nro docentes /Nro alumnos pregrado v.2"
cap label var ind1_`x'_3 "Nro docentes /Nro alumnos pregrado v.3"
cap label var ind1_`x'_4 "Nro docentes /Nro alumnos pregrado v.4"
cap label var ind1_`x'_5 "Nro docentes /Nro alumnos pregrado v.5"
cap label var ind1_`x'_6 "Nro docentes /Nro alumnos pregrado v.6"
cap label var ind1_`x'_7 "Nro docentes /Nro alumnos pregrado v.7"
cap label var ind1_`x'_8 "Nro docentes /Nro alumnos pregrado v.8"
cap label var ind1_`x'_9 "Nro docentes /Nro alumnos pregrado v.9"
}
and It worked in both files ( 1996 and 2010). However I can't include this command on those do files cause the idea is to only use the comand run dofile/labels.do in both of them and the labels file should work the same way as if I were using the command on them. The thing is, it doesn't and I can't figure out why... Any thoughts?
Related Posts with How to run a do file using a loop with capture
Interaction Variable in 2SLS regressionGood morning to the community, I would like to ask an econometric question on my dataset which is s…
fractional response with -glm- and -xtgee- vs. count model and -xtpoisson, fe?Dear Statalist members, I am analysing a balanced panel with about 2400 firms for 12 years (Stata 1…
multicollinearity problemplease guide me, what should i do with a variable, which is having problem of multicollinearity? i d…
Back log transformation with bias - FMM - GLM Poisson log linkDear all, I am running a FMM using a GLM with poisson and log link. My dependent variable is log tr…
Interpretation of marginsGiven a regression model, I understand that Code: margins, dydx(var1) gives us the average marginal…
Subscribe to:
Post Comments (Atom)
0 Response to How to run a do file using a loop with capture
Post a Comment