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
inquire about capture commandI see a data code that starts: Code: clear * capture cd "~/Dropbox/Projects/The Demand for Status/…
inquire foreach listI find that Code: foreach x in Gold Platinum_upgrade Platinum_upgrade_merit { in fact, there is no…
Is ROC curve for 3x3 table possible?Dear All, I have a confusing doubt in my mind. ROC curve for 3x3 or 2X3 table is possible? If so, 1.…
How to split?Dear All, I have this data set, Code: * Example generated by -dataex-. To install: ssc install data…
Gravity Model: reverse causality LEAD variableHi, I am trying to test for potential reverse causality between RTAs using a gravity model. RTA = …
Subscribe to:
Post Comments (Atom)
0 Response to How to run a do file using a loop with capture
Post a Comment