Stata 11 help for ereturn

help ereturn dialog: ereturn list -------------------------------------------------------------------------------

Title

[P] ereturn -- Post the estimation results

Syntax

Set macro returned by estimation command

ereturn local name ... (see [P] macro)

Set scalar returned by estimation command

ereturn scalar name = exp

Set matrix returned by estimation command

ereturn matrix name [=] matname [, copy ]

Clear e() saved results

ereturn clear

List e() saved results

ereturn list

Save coefficient vector and variance-covariance matrix

ereturn post [b [V [Cns]]] [weight] [, depname(string) obs(#) dof(#) esample(varname) properties(string) ]

Change coefficient vector and variance-covariance matrix

ereturn repost [b = b] [V = V] [Cns = Cns] [weight] [, esample(varname) properties(string) rename ]

Display coefficient table

ereturn display [, eform(string) first neq(#) plus level(#) ]

where name is the name of the macro, scalar, or matrix that will be returned in e(name) by the estimation program; matname is the name of an existing matrix; b is a 1 x p coefficient vector (matrix); V is a p x p covariance matrix; and Cns is a c x (p+1) constraint matrix.

fweights, aweights, iweights, and pweights are allowed; see weight.

Description

ereturn local, ereturn scalar, and ereturn matrix set e() macros, scalars, and matrices other than b, V, and Cns returned by estimation commands. See [R] return for more discussion on returning results.

ereturn clear clears the e() saved results.

ereturn list lists the names and values of the e() returned macros and scalars, and the names and sizes of the e() returned matrices from the last estimation command.

ereturn post clears all existing e-class results and saves the coefficient vector (b), variance-covariance matrix (V), and constraint matrix (Cns) in Stata's system areas, making available all the postestimation features described in postest. b, V, and Cns are optional for ereturn post; some commands (such as factor) do not have a b, V, or Cns but do set the estimation sample, e(sample), and properties, e(properties). You must use ereturn post before setting other e() macros, scalars, and matrices.

ereturn repost changes the b, V, or Cns matrix (allowed only after estimation commands that posted their results with ereturn post) or changes the declared estimation sample or e(properties). The specified matrices cease to exist after post or repost; they are moved into Stata's system areas. The resulting b, V, and Cns matrices in Stata's system areas can be retrieved by reference to e(b), e(V), and e(Cns). ereturn post and repost deal with only the coefficient and variance-covariance matrices, whereas ereturn matrix is used to save other matrices associated with the estimation command.

ereturn display displays or redisplays the coefficient table corresponding to results that have been previously posted using ereturn post or repost.

For a discussion of posting results with constraint matrices (Cns in the syntax diagram above), see [P] makecns, but only after reading this entry.

Options

copy specified with ereturn matrix indicates that the matrix is to be copied; that is, the original matrix should be left in place.

depname(string) specified with ereturn post supplies a name that should be that of the dependent variable but can be anything; that name is saved and added to the appropriate place on the output whenever ereturn display is executed.

obs(#) specified with ereturn post supplies the number of observations on which the estimation was performed; that number is saved and stored in e(N).

dof(#) specified with ereturn post supplies the number of (denominator) degrees of freedom that is to be used with t and F statistics and is saved and stored in e(df_r). This number is used in calculating significance levels and confidence intervals by ereturn display and by subsequent test commands performed on the posted results. If the option is not specified, normal (Z) and chi-squared statistics are used.

esample(varname) specified with ereturn post or ereturn repost gives the name of the 0/1 variable indicating the observations involved in the estimation. The variable is removed from the dataset but is available for use as e(sample); see [U] 20.6 Specifying the estimation subsample. If the esample() option is not specified with ereturn post, it is set to all zeros (meaning no estimation sample). See [P] mark for details of the marksample command that can help create varname.

properties(string) specified with ereturn post or ereturn repost sets the e(properties) macro. By default, e(properties) is set to b V if properties() is not specified.

rename is allowed only with the b = b syntax of ereturn repost and tells Stata to use the names obtained from the specified b matrix as the labels for both the b and V estimation matrices. These labels are subsequently used in the output produced by ereturn display.

eform(string) specified with ereturn display indicates that the exponentiated form of the coefficients is to be output and reporting of the constant is to be suppressed. string is used to label the exponentiated coefficients; see [R] eform_option.

first requests that Stata display only the first equation and make it appear as if only one equation were estimated.

neq(#) requests that Stata display only the first # equations and make it appear as if only # equations were estimated.

plus changes the bottom separation line produced by ereturn display to have a + symbol at the position of the dividing line between variable names and results. This is useful if you plan on adding more output to the table.

level(#), an option of ereturn display, supplies the significance level for the confidence intervals of the coefficients; see [R] level.

Examples

See [P] ereturn for the general outline of an estimation command program and for examples of ereturn post, repost, and display. Within such a program you could save e() results using something like

... ereturn local depvar "`depname'" ereturn scalar N = `nobs' ereturn matrix lambda lam ereturn local cmd "myestcmd" ...

The user of an estimation command would type

. ereturn list

to see what was returned from an estimation command.

--------------------------------------------------------------------------- Setup . sysuse auto . regress weight length displ

List saved results . ereturn list

Access individual e() results . display "the adjusted R-squared is: `e(r2_a)' . display "the residual sum-of-squares is: `e(r22)' . matrix list e(V) . matrix list e(b) ---------------------------------------------------------------------------

Saved results

ereturn post saves the following in e():

Scalars e(N) number of observations e(df_r) degrees of freedom, if specified

Macros e(wtype) weight type e(wexp) weight expression e(properties) estimation properties; typically b V

Matrices e(b) coefficient vector e(Cns) constraints matrix e(V) variance-covariance matrix of the estimators

Functions e(sample) marks estimation sample

ereturn repost saves the following in e():

Macros e(wtype) weight type e(wexp) weight expression e(properties) estimation properties; typically b V

Matrices e(b) coefficient vector e(Cns) constraints matrix e(V) variance-covariance matrix of the estimators

Functions e(sample) marks estimation sample

With ereturn post, all previously stored estimation results e() are removed. ereturn repost, however, does not remove previously stored estimation results. ereturn clear removes the current e() results.

Also see

Manual: [P] ereturn

Help: [P] _estimates, [P] return, [R] estimates, [U] 20 Estimation and postestimation commands (estimation), [U] 20 Estimation and postestimation commands (postestimation)


© Copyright 1996–2009 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index