Without loop function, I can run these two regressions separately: one with popgrowth and the other without it.
I want to use a foreach loop to achieve the same goal: use popgrowth in the first iteration and an empty string in the second iteration:
Stata complains "invalid something: quotes do not match" about the declaration of p12 macro. Is there an alternative to achieve this goal?
Code:
webuse lifeexp reg lexp gnppc popgrowth reg lexp gnppc
Code:
webuse lifeexp
local p12 "popgrowth" ""
foreach p in `p12'{
reg lexp gnppc `p'
}

Comment