Stata: Export OLS regression table to Word or Excel

Wednesday, May 27, 2009

Stata is a statistics software package with many neat modules that can help you to reduce your workload. One of my favorite modules is estout, which allows the export of your regression tables directly from Stata to Word documents or Excel. Isn’t that cool?


1. First, install this great module by typing the following command in Stata:
ssc install estout, replace

2. Run one OLS regression (the program can export many regression tables, but for now, we will limit ourselves to one).


3. When you are done, type the following:

esttab using test.rtf

4. You can find this file in my document\stata folder. It appears ike this:
5. If you are using have hierarchical regression/ nested regression, things can become a bit complicated. You have to store it by typing est store m1 after running your first regression. It would be look like this:

regress y x1 x2
est store m1
regress y x1 x2 x3 x4
est store m2
regress y x1 x2 x3 x4 x5 x6
est store m3
esttab * using test.rtf, replace 

6. The export file would appear like this:


7. If you would prefer the output to be in Excel format, you can use test.csv.
Related Posts Plugin for WordPress, Blogger...


One response to “Stata: Export OLS regression table to Word or Excel”
Post a Comment | Post Comments (Atom)

Post a Comment