Stata: Export Logistic Regression (Coefficient/Odds ratio) to Word or Excel

Thursday, June 4, 2009

Stata provides two commands for logistic regression: logit and logistic. Logit reports coefficients; whereas logistic reports odds ratios. The general command for logistic regression appears like this:

logit y x
logistic y x


Logit output:
1.png

Logistic output:
2.png

If you want to export the coefficients to Word or Excel, it is the same as exporting an OLS regression. Here is the code I used:

esttab * using logistic1.csv, b(3) pr2

Exporting odds ratios requires transformation. The key is “eform” at the end of this command:

esttab * using logistic2.rtf, b(3) pr2 eform

and the results in Word look like this:
3.png

If you require t-test, you may use the following code:

esttab * using logistic3.csv, cells("b(fmt(3) star)" t(par fmt(2))) pr2 
 
Related Posts Plugin for WordPress, Blogger...

Comments

No response to “Stata: Export Logistic Regression (Coefficient/Odds ratio) to Word or Excel”
Post a Comment | Post Comments (Atom)

Post a Comment