Exporting stata results to word/excel: Final thoughts


Extensive search and asking my trustful Stata friend, it was the best to use 'estout' and copy the table and paste to Excel.
Here is the syntax using the NHANES demo data (nhanes2).

webuse nhanes2, clear
logistic highbp weight i.agegrp i.sex
eststo Model1
logistic highbp weight agegrp##sex
eststo Model2
estout Model1 Model2, cells("b(fmt(2) label(OR)) ci(par fmt(2) label(95%CI))") eform drop(_cons)  nonumber nobase

All 95%CI in parentheses, all aligned with no extra characters!
You can add p-values if you like and add the sub-command 'label', replacing Stata variable names with variable labels, which is:

estout Model1 Model2, cells("b(fmt(2) label(OR)) ci(par fmt(2) label(95%CI)) p(fmt(4) label (p-value))")  eform drop(_cons) nonumber nobase legend label

Happy Stata-ing!

Comments