Hi!
In medical research, regression tables like the example below are common - I would like to automatically create them. Notably, the unadjusted column contains results from two univariable models.
I looked into collect or etable and it's straightforward to create a table with 3 columns (2 univariable models, 1 multivariable) but that's not the intended result. Does anyone know how to do this?

I used to create them using estout and then the resulting file in excel to half-manually create the final table as above.
which outputs the file:
In medical research, regression tables like the example below are common - I would like to automatically create them. Notably, the unadjusted column contains results from two univariable models.
I looked into collect or etable and it's straightforward to create a table with 3 columns (2 univariable models, 1 multivariable) but that's not the intended result. Does anyone know how to do this?
I used to create them using estout and then the resulting file in excel to half-manually create the final table as above.
Code:
webuse cancer stset study died foreach var of varlist drug age { stcox `var' estimates store `var' } stcox drug age estimates store multi estout drug age multi using coxtable.txt, cells(b(fmt(2))) eform replace estout drug age multi using coxtable.txt, cells(ci(fmt(2))) eform append estout drug age multi using coxtable.txt, cells(p(fmt(3))) eform append
which outputs the file:
Code:
drug age multi b b b drug 0.26 0.22 age 1.08 1.12 drug age multi ci95 ci95 ci95 drug 0.15,0.46 0.12,0.40 age 1.01,1.15 1.04,1.20 drug age multi p p p drug 0.000 0.000 age 0.023 0.002
Comment