I have local variables x1 , x2, and x3
as follows
local x1 2 3 5
local x2 5 9 7
local x3 1 3 4
Now I define local x
as
local x `x1' `x2' `x3'
Next, I define for loop as
foreach var of varlist `x'{
reg y `var'}
The problem is that stata is giving me the error (note y
is dependent variable)
invalid name
Any suggestion in this regard will be highly appreciated.
x1
,x2
, andx3
macros of variable names? What are 1-9? – Richard Herron