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
Fixed effects model: how do I take account of non-uniform time intervals?Good morning all, Hope you're well. Apologies if this is a very basic enquiry but I am still findin…
Splitting dataHi, I have a data set on mortgage lending for single family homes and I have a total of 10,000 obser…
Double-cluster pooled OLSGood day to all. Is there any researcher know how to interpret the double-clustering pooled OLS? My …
How to replace each variable with values of subsquent observationHi all, I've got a question regarding replacing values of variables with values from subsequent obs…
COVID-19 symptoms graphic I was asked off-forum by someone in the medical field if I knew of how to create the graphic below.…
Subscribe to:
Post Comments (Atom)
0 Response to How to run a do file using a loop with capture
Post a Comment