Dear Statalisters,

I am trying to use a global macro that contains a reference to a loop (`var').
This is the original code:

Code:
levelsof country, local(levels) 
foreach l of local levels {
foreach var of varlist y1 y2 y3 {
eststo `var'_`l': reg `var' x1 if country== "`l'"
}
}
foreach var of varlist y1 y2 y3 {
local graphtitle : variable label `var'
coefplot (`var'_Argentina \ `var'_Austria \ `var'_Belgium \ `var'_Brazil)
I want to create a global macro with the names of the models I want Stata to run:

Code:
global countries "(`var'_Argentina \ `var'_Austria \ `var'_Belgium \ `var'_Brazil)"
Next, I use the $ command, where I substitute this text for $countries:

Code:
levelsof country, local(levels) 
foreach l of local levels {
foreach var of varlist y1 y2 y3 {
eststo `var'_`l': reg `var' x1 if country== "`l'"
}
}
foreach var of varlist y1 y2 y3 {
local graphtitle : variable label `var'
coefplot $countries
However, Stata seems not to identify the `var' before the country name, and the output is the following one:

estimation result _Argentina not found
Is there a way to use a global macro with loop content inside?

Thanks in advance,
Marc