In Stata, I try to save a dta
file using local and global macros together in file names.
However, the local macros are not parsed correctly.
The global macro result
is a folder directory which is:
global result "C:\Users\...\....\..."
The local macro x
is defined in a loop:
foreach x of varlist ret_yyy {
.......
save "$result\Reg_Coefficients\`x'", replace
}
This only produces a file under a "result" folder with name "Reg_Coefficients`x'".
What I expect is to save a file under folder "Reg_Coefficients".