The issue I'm having is that when I have a variable list after egen, and the variable list is comprised of macros from loops, Stata/SE 16.1 for Windows (64-bit x86-64) is interpreting the variable list as one long variable name (i.e. interpreting it as through there weren't spaces between the variables in the variable list).
So, for instance, if I wrote:
Code:
forvalues i=1/3 { foreach pre in a_ b_ c_ { egen r`i'`pre'max = rowmax(r`i'`pre's r`i'`pre'q r`i'`pre'w) } }
But I use find and replace to change those local macro identifiers into the first instance of each of the loops (show below) it works just fine.
Code:
egen r1a_max = rowmax(r1a_s r1a_q r1a_w)
Any help is appreciated.
Kind regards,
Ben
0 Response to trouble with variable list in egen using macros from loops
Post a Comment