help estcom
-------------------------------------------------------------------------------
Title
[U] 20 Estimation and postestimation commands
Description
For a list of Stata's estimation commands, see [I] estimation commands.
For a discussion of postestimation commands, see postest.
Properties shared by all estimation commands are listed.
Remarks
Stata commands that fit statistical models -- commands such as logit,
regress, logistic, and sureg -- work similarly.
Remarks are presented under the following headings:
1. Common syntax
2. Estimation on subsamples
3. Robust variance estimates
4. Prefix commands
5. Confidence intervals of parameters
6. Tests of parameters
7. Point estimates and CIs of linear and nonlinear combinations
8. Predictions
9. Generalized predictions
10. Marginal means, predictive margins, marginal effects, and average
marginal effects
11. Estimation statistics
12. Variance-covariance matrix of the estimators (VCE)
13. Coefficients and standard errors in expressions
14. Managing and combining estimates
15. Redisplaying estimates
16. Factor rotations
17. Specialized graphs
1. Common syntax
Single-equation estimation commands usually have syntax
command varlist [if] [in] [weight] [, options]
and multiple-equation estimation commands usually have syntax
command (varlist) ... (varlist) [if] [in] [weight] [, options]
In single-equation commands, the first variable in varlist is the
dependent variable and the remaining are the independent variables,
although there can be variations. For instance, anova allows you to
specify terms in addition to variables for the independent variables.
2. Estimation on subsamples
You can use Stata's standard syntax (if and in) to restrict the sample;
you do not have to make a special dataset.
3. Robust variance estimates
Most estimation commands allow option vce(robust), which provides the
Huber/White/sandwich estimator of variance. Those that do also provide
option vce(cluster clustvar), which relaxes the assumption of
independence. See [U] 20.16 Obtaining robust variance estimates.
4. Prefix commands
Prefix commands may be used to modify the estimation command. The syntax
is
prefix_command ... : command ...
where
prefix_command description
---------------------------------------------------------------------
statsby: collect results across subsets of the data
rolling: collect statistics on moving subsets
bootstrap: bootstrap estimation
jackknife: jackknife estimation
* svy: estimation with complex survey data
* mi estimate: run command on multiply imputed data and adjust
results for multiple imputation (MI)
* nestreg: run command with accumulated blocks of
regressors and report nested model comparison
tests
* stepwise: stepwise estimation
* fracpoly: run command with fractional polynomials of one
regressor
* mfp: run command with multiple fractional polynomial
regressors
---------------------------------------------------------------------
* Available for most but not all estimation commands.
See help prefix for a full list of prefix_commands.
Before using the bootstrap: or jackknife: prefixes, however, check
whether the estimation command allows option vce(bootstrap) or
vce(jackknife). If it does, using the option rather than the prefix is
better. The option is implemented in terms of the prefix command, but
the option automatically knows to pass all the appropriate suboptions for
the specific estimator you are using.
5. Confidence intervals of parameters
Estimation commands display confidence intervals of the coefficients.
Estimation-command option level() specifies the width of the interval.
The default is level(95), meaning 95% confidence intervals.
You can reset the default with set level.
6. Tests of parameters
You can perform tests on the estimated parameters by using
o test -- Wald test of linear hypotheses
o testnl -- Wald test of nonlinear hypotheses
o lrtest -- likelihood-ratio tests
o hausman -- Hausman specification test
o suest -- generalization of the Hausman test
7. Point estimates and CIs of linear and nonlinear combinations
You can obtain point estimates and confidence intervals of linear
combinations of the estimated parameters by using lincom, and those of
nonlinear combinations by using nlcom.
8. Predictions
You can obtain predictions, residuals, influence statistics, and the
like, either for the data on which you just estimated or for some other
data, by using predict.
The help for predict is found in two places:
1. help predict -- general information
2. help estimation_command postestimation -- specific information
and special features following estimation by estimation_command.
For instance, help regress postestimation tells you about predict
following regress.
The easy way to access the postestimation help is to see [R] regress (or
whatever estimation command you are using) and then select
postestimation.
9. Generalized predictions
You can obtain nonlinear predictions, standard errors, Wald test
statistics, significance levels, and confidence intervals, either for the
data on which you just estimated or for some other data, by using
predictnl.
One especially useful feature of predictnl is that you can obtain
standard errors for most predictions available via predict, and you can
obtain standard errors of functions and combinations of these
predictions.
10. Marginal means, predictive margins, marginal effects, and average
marginal effects
Command margins estimates marginal means, adjusted predictions, marginal
effects, partial effects, or other expressions at fixed values for the
regressors; or it estimates averages of means, adjusted predictions,
marginal effects, partial effects, or other expressions at fixed values
of some covariates and averaging over the rest, said averaging based on
the data currently in memory.
11. Estimation statistics
Command estat displays scalar- and matrix-valued postestimation
statistics such as AIC and BIC.
12. Variance-covariance matrix of the estimators (VCE)
Command estat vce displays the VCE -- either as a covariance matrix or as
a correlation matrix.
You can obtain the coefficients and VCE into Stata matrices by using e(b)
and e(V) in expressions.
You can obtain the coefficients and VCE into Mata matrices by using
st_matrix(e(b)) and st_matrix(e(V)); see [M-5] st_matrix().
13. Coefficients and standard errors in expressions
You can refer to the coefficients and standard errors in expressions by
using _b[name] and using _se[name], such as
. generate contribution = _b[mpg]*mpg
See [U] 13.5 Accessing coefficients and standard errors and see _b.
14. Managing and combining estimates
You can store estimation results with command estimates store. These
estimation results may later be restored and replayed, the coefficients
of one or more may be combined in a table, etc.; see [R] estimates.
Programmers should also see command [P] _estimates, which is a low-level
tool that manages stored estimation results.
15. Redisplaying estimates
You can, at any time, review your most recent estimates by typing the
estimation command without arguments.
16. Factor rotations
You can rotate loadings after factorlike commands; see [MV] rotate.
17. Specialized graphs
There are specialized graph commands available after some estimation
commands.
For instance, command lroc will graph the ROC curve after logistic,
logit, probit, or ivprobit. Command screeplot will make scree plots
after factor or pca, as well as various other multivariate commands.
What is available can always be found in the postestimation section of
the documentation following the estimator.
Also see
Manual: [U] 20 Estimation and postestimation commands,
[U] 26 Overview of Stata estimation commands,
[I] estimation commands
Help: [I] estimation commands, [U] 20 Estimation and postestimation
commands (postestimation);
[R] bootstrap, [P] ereturn, [R] estat, [R] estimates, [R]
hausman, [R] jackknife, [R] level, [R] lincom, [R] linktest, [R]
lrtest, [R] margins, [R] nlcom, [R] permute, [R] predict, [R]
predictnl, [P] return, [MV] rotate, [R] stepwise, [R] simulate,
[D] statsby, [R] suest, [SVY] svy, [R] test, [R] testnl