In the following loop, in line 4, I would like Stata to print the value stored in the global macro created in line 3 but the correct syntax continues to escape me.
The macro list command following the loop verifies that $a_w thru $d_z are created with the intended content.
* ========== start loop
foreach x in a b c d {
foreach a in w x y z {
glo `x'_`a' = runiform()
di `"$`x'_`a'"'
}
}
macro list
* ========== end loop
Thanks in advance for any advice (particularly, the logic involved).
Best,
r
The macro list command following the loop verifies that $a_w thru $d_z are created with the intended content.
* ========== start loop
foreach x in a b c d {
foreach a in w x y z {
glo `x'_`a' = runiform()
di `"$`x'_`a'"'
}
}
macro list
* ========== end loop
Thanks in advance for any advice (particularly, the logic involved).
Best,
r
Comment