Dear all,
I have multiple different dependent variables (six in total but this can become more) and I would like to create a loop that runs the regression for each dependent variable and then stores the results for each regression. After this, I'd like to present the results for the different models in a nice output table.
It seems like something fairly simple but I just can't find how to do this. I was thinking in the line of:
local i = 1
foreach var of global y_vars {
probit `var' i.treatment $var_demo $var_location
estimates store m`i'
local `i' = `i' + 1
}
log using "Example.smcl", append
estout m1 m2 m3 m4 m5 m6, keep(*.treatment) cells(b(star fmt(3)) se(fmt(3))) starlevels(* 0.10 ** 0.05 *** 0.01) stardetach ///
legend label varlabel (_cons Constant) varwidth(15)
log close
But this clearly doesn't work because it only stores the estimates of the first dependent variable.
Does someone have advice for me? Thanks!
I have multiple different dependent variables (six in total but this can become more) and I would like to create a loop that runs the regression for each dependent variable and then stores the results for each regression. After this, I'd like to present the results for the different models in a nice output table.
It seems like something fairly simple but I just can't find how to do this. I was thinking in the line of:
local i = 1
foreach var of global y_vars {
probit `var' i.treatment $var_demo $var_location
estimates store m`i'
local `i' = `i' + 1
}
log using "Example.smcl", append
estout m1 m2 m3 m4 m5 m6, keep(*.treatment) cells(b(star fmt(3)) se(fmt(3))) starlevels(* 0.10 ** 0.05 *** 0.01) stardetach ///
legend label varlabel (_cons Constant) varwidth(15)
log close
But this clearly doesn't work because it only stores the estimates of the first dependent variable.
Does someone have advice for me? Thanks!

Comment