Hi,
I would like to define a new macro variables with the same variables that are in a first macro variable defined formerly but each variable would have "r" at the beginning of the name. The following code illustrate what I'm trying to achieve.
Note that I have many variables and I do not want to add manually an "r" at the beginning of each variable of the second global macro...
I would like to define a new macro variables with the same variables that are in a first macro variable defined formerly but each variable would have "r" at the beginning of the name. The following code illustrate what I'm trying to achieve.
Code:
sysuse auto, clear global var "headroom trunk weight length turn" foreach i in $var{ gen r`i'= `i'*100 } global rvar r$var /* this is wrong, but do not know how to code it */
Comment