Save results in e()
eret2 local name ... [, replace ]
eret2 scalar name = exp [, replace ]
eret2 matrix name [=] matname [, copy replace ]
where name is the name of the macro, scalar, or matrix that will be returned in e(name) and matname is the name of an existing matrix.
Description
eret2 is a hack to save a macro, scalar, or matrix in e() and may be used after any estimation command (see help estcom) to add additional results to the e()-returns. It is implemented as a wrapper for the ereturn command (see help ereturn). However, eret2 can be used in any context whereas ereturn can only be used within an e-class program (see help program).
eret2 may be useful, for example, if the estimation results be tabulated by estimates table or estout (available from the SSC archive; type ssc describe estout).
Options
copy specified with eret2 matrix indicates that the matrix is to be copied, leaving the original in place. The default is to move the matrix.
replace permits eret2 to replace an existing e() macro, scalar, or matrix.
Examples
. sysuse auto . regress price weight mpg . test weight = mpg . eret2 scalar p_wtmpg = r(p)
Author
Ben Jann, ETH Zurich, jann@soz.gess.ethz.ch
Also see
Online: help for ereturn, estimates, program, return, estcom, matrix,