Code:
set obs 10 local i = 1 local xx noisily while `i' < 5 { cap `xx' { gen a`i' = runiform() in 1/9 } local i = `i' + 1 }
Here's the error message I get with Stata 15.1:
Code:
. set obs 10 number of observations (_N) was 0, now 10 . local i = 1 . local xx noisily . while `i' < 5 { 2. cap `xx' { 3. gen a`i' = runiform() in 1/9 4. } 5. local i = `i' + 1 6. } (1 missing value generated) (1 missing value generated) (1 missing value generated) (1 missing value generated) } is not a valid command name r(199);
Code:
set obs 10 local i = 1 while `i' < 5 { cap noisily { gen a`i' = runiform() in 1/9 } local i = `i' + 1 }
Thanks!
0 Response to Macro expansion in a while loop
Post a Comment