Store estimates

The postestimation commands as well as the return and ereturn list only work on the last estimation. How can you store and recover estimations?

// Load auto data
sysuse auto, clear


*** Run models and store them ***

// First model: Weight & length as explanatory variables
reg price weight length

// Store estimation model & results under the name "e1"
estimates store e1

// Second model: Weight, length & foreign as explanatory variables
reg price weight length i.foreign

// Store estimation model & results under the name "e1"
estimates store e2


*** Display stored models ***

// List all stored estimations
estimates dir

// Result table for stored estimations
estimates table e1 e2
/* Note:
There are more options to make this table nicer, but consider using the 
esttab command instead (see chapter on Tables & Graphs).
*/

// Display a specific estimation
estimates replay e1


*** Use stored models ***

// Use a postestimation command
estat ic
//!\\ Although we just displayed e1, the last stored model is e2 //!\\

// Use estimates restore to actually re-load a model
estimates restore e1
estat ic