## Stata 15 help for ologit postestimation

```
[R] ologit postestimation -- Postestimation tools for ologit

Postestimation commands

The following postestimation commands are available after ologit:

Command            Description
-------------------------------------------------------------------------
contrast         contrasts and ANOVA-style joint tests of estimates
estat ic         Akaike's and Schwarz's Bayesian information criteria
(AIC and BIC)
estat summarize  summary statistics for the estimation sample
estat vce        variance-covariance matrix of the estimators (VCE)
estat (svy)      postestimation statistics for survey data
estimates        cataloging estimation results
* forecast         dynamic forecasts and simulations
* hausman          Hausman's specification test
lincom           point estimates, standard errors, testing, and
inference for linear combinations of coefficients
* lrtest           likelihood-ratio test
margins          marginal means, predictive margins, marginal effects,
and average marginal effects
marginsplot      graph the results from margins (profile plots,
interaction plots, etc.)
nlcom            point estimates, standard errors, testing, and
inference for nonlinear combinations of coefficients
predict          predictions, residuals, influence statistics, and
other diagnostic measures
predictnl        point estimates, standard errors, testing, and
inference for generalized predictions
pwcompare        pairwise comparisons of estimates
suest            seemingly unrelated estimation
test             Wald tests of simple and composite linear hypotheses
testnl           Wald tests of nonlinear hypotheses
-------------------------------------------------------------------------
* forecast, hausman, and lrtest are not appropriate with svy estimation
results.  forecast is also not appropriate with mi estimation results.

Syntax for predict

predict [type] {stub* | newvar | newvarlist} [if] [in] [, statistic
outcome(outcome) nooffset]

predict [type] {stub* | newvarlist} [if] [in] , scores

statistic          Description
-------------------------------------------------------------------------
Main
pr               predicted probabilities; the default
xb               linear prediction
stdp             standard error of the linear prediction
-------------------------------------------------------------------------
If you do not specify outcome(), pr (with one new variable specified)
assumes outcome(#1).
You specify one or k new variables with pr, where k is the number of
outcomes.
You specify one new variable with xb and stdp.
These statistics are available both in and out of sample; type predict
... if e(sample) ... if wanted only for the estimation sample.

Statistics > Postestimation

Description for predict

predict creates a new variable containing predictions such as
probabilities, linear predictions, and standard errors.

Options for predict

+------+
----+ Main +-------------------------------------------------------------

pr, the default, calculates the predicted probabilities.  If you do not
also specify the outcome() option, you specify k new variables, where
k is the number of categories of the dependent variable.  Say that
you fit a model by typing ologit result x1 x2, and result takes on
three values.  Then you could type predict p1 p2 p3 to obtain all
three predicted probabilities.  If you specify the outcome() option,
you must specify one new variable.  Say that result takes on the
values 1, 2, and 3.  Typing predict p1, outcome(1) would produce the
same p1.

xb calculates the linear prediction.  You specify one new variable, for
example, predict linear, xb.  The linear prediction is defined,
ignoring the contribution of the estimated cutpoints.

stdp calculates the standard error of the linear prediction.  You specify
one new variable, for example, predict se, stdp.

outcome(outcome) specifies for which outcome the predicted probabilities
are to be calculated.  outcome() should contain either one value of
the dependent variable or one of #1, #2, ..., with #1 meaning the
first category of the dependent variable, #2 meaning the second
category, etc.

nooffset is relevant only if you specified offset(varname) for ologit.
It modifies the calculations made by predict so that they ignore the
offset variable; the linear prediction is treated as xb rather than
as xb + offset.

scores calculates equation-level score variables.  The number of score
variables created will equal the number of outcomes in the model.  If
the number of outcomes in the model was k, then

The first new variable will contain the derivative of the log
likelihood with respect to the regression equation.

The other new variables will contain the derivative of the log
likelihood with respect to the cutpoints.

Syntax for margins

margins [marginlist] [, options]

margins [marginlist] , predict(statistic ...) [predict(statistic ...)
...] [options]

statistic          Description
-------------------------------------------------------------------------
default            probabilities for each outcome
pr                 probability for a specified outcome
xb                 linear prediction
stdp               not allowed with margins
-------------------------------------------------------------------------
pr defaults to the first outcome.

Statistics not allowed with margins are functions of stochastic
quantities other than e(b).

For the full syntax, see [R] margins.

Statistics > Postestimation

Description for margins

margins estimates margins of response for probabilities and linear
predictions.

Examples

Setup
. webuse fullauto
. ologit rep77 i.foreign length mpg

Predicted probabilities for each of the five outcomes
. predict poor fair avg good exc

Average marginal effects on the probability of an excellent repair record
. margins, dydx(*) predict(outcome(5))

Report information criteria
. estat ic

```