in my analysis I have a simple regression with multiple dependent variables. The dependent variables are stored in locals and the regression command is embedded into a loop.
Now, I would like to include several sets of control variables (also stored in locals). Thereby, some sets of control variables should only be included in the regression for a specific dep var.
Please notice the following simplified example:
Code:
*define control variables local control_general x2 x3 local control_depvar1 x4 x5 *define dependent variables local depvar depvar1 depvar2 depvar3 *regression eststo clear foreach y of local depvar { eststo `y': reg `y' x1 $control_general $control_depvar1 estadd $control_depvar1 if `x' == depvar1 }
Code:
estadd $control_depvar1 if `x' == depvar1
Thank you very much in advance!
Warm regards,
Bianca
0 Response to Regression Loop: Include Condition for Set of Control Vars
Post a Comment