I am trying to refer to a macro inside a loop in Stata. A simple example below.
local x1 age race gender
local x2 age race gender city
local nums 1 2
foreach i of local nums{
reg y $x`i'
}
I'd like the loop to go through two calues of i(i = 1,2) and run the two regressions. I am having trouble referring to the macro - any help would be appreciated!