Hi, I am trying to create a weird list to use in a gmm estimation command of this form `dv':varname for many variables (with a space in between). Specifically, I wanna create a list and put it in a macro like:
and then use this list to run in an estimation like:
But as you can see the problem is that this macro can't be use in the command because typing `coef_linear' would not give me the same results and the display command show. The -macro list- command confirms this. I have been struggle to get around this issue, and furthermore to better understand how to manipulate list effectively using nested macros. I was wondering if you anyone could give me some suggestions? I guess the main difficulty is to preserve the quote ` ' and the colon in the macro
Thanks so much!
Code:
local linear weight length turn foreach var of local linear { local coef_linear "`coef_linear'" "`"`"dv"'"':`var' " } di "`coef_linear'" macro list
Code:
gmm gmm_reg2, nequations(1) parameters(`coef_linear' `dv':_cons) /// instruments(weight length turn) mylhs(`dv') nolog
Thanks so much!
Comment