In Stata, how do I save multiple model estimates to a single table of results?
Stata can store estimates from multiple models, save all
estimates in a single table, and export the table to an external file,
rtf, csv, html, tex, and others. This is possible
.esttab command from the
package, which you can install from the Stata packages repository.
Suppose you wish to compare two regression models, only one of which
is estimated with robust clustered errors. Immediately after
estimating each model, store the estimates in Stata memory with the
.estimates store command:
. reg Y X1 X2 X3 . estimates store model1 . reg Y X1 X2 X3, cl(id) . estimates store model2
To save the two models in a single table in an external file, use the
. esttab model1 model2 using C:\temp\results.rtf, b(2) se(2) r2
Specify the names of the stored estimates,
model2, and the directory where the table of results should be saved. The extension of the file determines the file format, in this case
se() options indicate that the point estimates and standard errors, respectively, should be rounded to the second decimal place. The option
r2 will display the R-squared statistic for each model. For additional options on displaying summary statistics and customizing table layout, type:
. help esttab
If you have questions about using statistical and mathematical software at Indiana University, email UITS Research Analytics. Research Analytics is located on the IU Bloomington campus at Woodburn Hall 200, and is open for consultation by appointment Monday-Friday 9am-5pm. For more, see Research Analytics, or call 812-855-4724 (IUB) or 317-278-4740 (IUPUI).
This is document azuu in the Knowledge Base.
Last modified on 2014-06-25.
- Fill out this form to submit your issue to the UITS Support Center.
- Please note that you must be affiliated with Indiana University to receive support.
- All fields are required.