Hi all,
I have 30 different regressions I would like to run using the same independent variables. I understand that when I set up locals as follows, independent variables are easy to reference during the regression (let y1 be some outcome of interest):
However, when I define a local with a set of outcome variables, I cannot get it to work in a loop:
The above only produces one regression that has y1 as the dependent variable and y2 as an independent variable (the controls work). Does anybody know what I'm doing wrong here? Also, of secondary concern, I would like to store each estimate as the name of the dependent variable so that I can visualize the results with
I have 30 different regressions I would like to run using the same independent variables. I understand that when I set up locals as follows, independent variables are easy to reference during the regression (let y1 be some outcome of interest):
Code:
local controls x1 x2 x3 i.x4 reg y1 $controls
Code:
local outcomes y1 y2 foreach i in outcomes { reg $outcomes $controls }
Code:
estimates table y1 y2, se p keep(coefficient of interest)
Comment