Hi All,
Does anyone know an easy way of converting macros into variables?
I'm trying something like the following.
local x1=1
local x2=2
local vl "x1 x2"
foreach v of loc vl {
gen "`v'"=`"`v'"'
}
I end up with error message
"x1 invalid name
r(198);
How to interprete this?
I guess there is better method to achieve the goal. Any hint will be
appreciated.
Thanks.
Luhang
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/