Hi,
I am trying to add a different column with the regression results for each of the variables in the varlist and have the last regression rewriting at the end. Would appreciate any leads on how I can fix this.
foreach var of varlist cd1 cd2 cd3 cd4 cd5 {
quietly: regress lv i.`var'_quintile
estimates store model1
quietly: regress lv_mass age i.racecat i.cohort i.educabas_cat i.`var'_quintile
estimates store model2
quietly: regress lv age i.racecat i.cohort i.educabas_cat i.`var'_quintile
estimates store model3
local all_models `all_models' model1 model2 model3
etable, estimates(model1 model2 CVD) mstat(N) mstat(r2_a) column(index) ///
showstars showstarsnote cstat(_r_b) title("Hep C association") cstat(_r_ci, nformat(%6.1f) cidelimiter(",")) ///
export("/Users/test.xlsx", as(xlsx) sheet(Sheet2) cell(A1) append)
}
I am trying to add a different column with the regression results for each of the variables in the varlist and have the last regression rewriting at the end. Would appreciate any leads on how I can fix this.
foreach var of varlist cd1 cd2 cd3 cd4 cd5 {
quietly: regress lv i.`var'_quintile
estimates store model1
quietly: regress lv_mass age i.racecat i.cohort i.educabas_cat i.`var'_quintile
estimates store model2
quietly: regress lv age i.racecat i.cohort i.educabas_cat i.`var'_quintile
estimates store model3
local all_models `all_models' model1 model2 model3
etable, estimates(model1 model2 CVD) mstat(N) mstat(r2_a) column(index) ///
showstars showstarsnote cstat(_r_b) title("Hep C association") cstat(_r_ci, nformat(%6.1f) cidelimiter(",")) ///
export("/Users/test.xlsx", as(xlsx) sheet(Sheet2) cell(A1) append)
}
Comment