UITS

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, such as rtf, csv, html, tex, and others. This is possible with the .esttab command from the estout 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 command:

  . esttab model1 model2 using C:\temp\results.rtf, b(2) se(2) r2

Specify the names of the stored estimates, model1 and model2, and the directory where the table of results should be saved. The extension of the file determines the file format, in this case rtf. The b() and 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.

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.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.