Hi,
I have several loops that run through a series of regressions for a set of dependent variables in the local macro. See below:
I am trying to exclude a specific dep var from only 1 of the loops without setting a new local macro. My current code looks like this:
However, this does not work. Is there a way to deal with this within the if statement I have? Another iteration that also don't work:
Another note - I would like this to be able to include multiple variables in the excluded list.
I know I could reset the local without the excluded var but this is not my preference for this workflow.
I'd appreciate any help statalist can provide.
Henry
I have several loops that run through a series of regressions for a set of dependent variables in the local macro. See below:
Code:
local vars var1 var2 .... foreach depvar in `vars' { reg `depvar' controlvars1..... ... } foreach depvar in `vars' { reg `depvar' controlvars2 ..... ... }
Code:
local vars var1 var2 .... foreach depvar in `vars' { if `depvar' != var1 { reg `depvar' controlvars1..... ... }
Code:
if "`depvar'" != "var1"
I know I could reset the local without the excluded var but this is not my preference for this workflow.
I'd appreciate any help statalist can provide.
Henry
Comment