bill999
bill999

Reputation: 2529

How to access elements from previously-stored estimates

Say that I have use this data to run these regressions and store the output:

eststo clear
sysuse auto2, clear

eststo e_mpg: reg price mpg
eststo e_trunk: reg price trunk

I now want to be able to access the _b and _se components of e_mpg.

I can see them displayed by:

estimates replay e_mpg

However, running the following does not work:

estimates use e_mpg

Basically, I want to have these estimates be in the current memory so that I can access _se[...] and _b[...] or, if that is not possible, access something from ereturn list or return list or some other solution.

Upvotes: 0

Views: 416

Answers (1)

user8682794
user8682794

Reputation:

You need to use estimates restore instead:

eststo clear
sysuse auto2, clear

eststo e_mpg: regress price mpg
eststo e_trunk: regress price trunk

estimates restore e_mpg
(results e_mpg are active now)

matrix list e(b)
e(b)[1,2]
           mpg       _cons
y1  -238.89435   11253.061

display _b[mpg]
-238.89435

display _se[mpg]
53.076687

Upvotes: 2

Related Questions