help postest
-------------------------------------------------------------------------------
Title
[U] 20 Estimation and postestimation commands
Description
See postestimation commands for a list of Stata's postestimation
commands. See estcom for a description of estimation commands and their
properties.
Estimation commands save results in e(). These saved results remain
available until the next estimation command is executed. e() acts as a
function that returns the value of the named estimation result from the
last estimation command. You can see what is available by typing
. ereturn list
after an estimation command. See ereturn and return.
All estimation commands save e(sample), indicating which observations
were used in the estimation. This can then be used with almost any Stata
command after estimation to restrict that command to the estimation
sample.
Examples
We use regress; other estimation commands may also be used.
. sysuse auto
. regress mpg weight c.weight#c.weight i.foreign
We can view the estimation matrices:
. matrix list e(b)
. matrix list e(V)
The estat vce command provides another way of viewing the covariance
matrix:
. estat vce
. estat vce, corr
. estat vce, eigen
We can examine the Akaike and Bayesian information criteria:
. estat ic
We can summarize the variables involved in the estimation command over
the observations used in the estimation:
. estat summarize
Other postestimation commands may also be used.
. margins
. lincom 3*weight + 500*1.foreign
. linktest
. test weight=1.foreign
. testnl _b[weight]/_b[c.weight#c.weight] = _b[1.foreign]
. predict r, residuals
The coeflegend option tells us how we can specify coefficients in
postestimation commands, such as test and testnl.
. regress, coeflegend
e(sample) can be used with any other Stata command after estimation.
. summarize rep78 if e(sample), detail
. summarize rep78 if !e(sample), detail
We can even obtain predictions on different data:
. webuse newautos, clear
. predict mpg
Also see
Manual: [U] 18.9 Accessing results calculated by estimation commands,
[U] 20 Estimation and postestimation commands,
[U] 26 Overview of Stata estimation commands,
[I] estimation commands
Help: [I] postestimation commands, [U] 20 Estimation and
postestimation commands (estimation);
[P] ereturn, [R] estat, [R] estimates, [R] hausman, [R] level,
[R] lincom, [R] linktest, [R] lrtest, [R] margins, [R] nlcom,
[R] predict, [R] predictnl, [P] return, [R] suest, [R] test, [R]
testnl