[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Mixing global macros with local macros
I'm running Stata 6.0 and I want to set some global
macros in one program and then access them, in a
general way in another.
This is what I want to do:
* In the main program I set the globals
for num 2/10: global skipX=0
* Then in the something.do file I want to repeatedly
* do some regressions and simulations, but only if
* a $skip macro is not equal to 1
reg y x w z, if b==`i'
* etc, etc
But when the while-loop expands the $skip`i' it doesn't
expand it to $skip1, $skip2, etc.
How can I accomplish this in a generalized and hopefully
not too cumbersome way?
Michael Ganz, MS, PhD
Dept. of Maternal and Child Health
Harvard School of Public Health
* For searches and help try: