**[XT] xtlogit postestimation** -- Postestimation tools for xtlogit

__Postestimation commands__

The following postestimation commands are available after **xtlogit**:

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)
**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
**test** Wald tests of simple and composite linear hypotheses
**testnl** Wald tests of nonlinear hypotheses
-------------------------------------------------------------------------
* **estat ic** and **lrtest** are not appropriate after **xtlogit, pa**.
+ **forecast** is not appropriate with **mi** estimation results or after
**xtlogit, fe**.

__Syntax for predict__

Random-effects model

**predict** [*type*] *newvar* [*if*] [*in*] [**,** *RE_statistic* __nooff__**set**]

Fixed-effects model

**predict** [*type*] *newvar* [*if*] [*in*] [**,** *FE_statistic* __nooff__**set**]

Population-averaged model

**predict** [*type*] *newvar* [*if*] [*in*] [**,** *PA_statistic* __nooff__**set**]

*RE_statistic* Description
-------------------------------------------------------------------------
Main
**xb** linear prediction; the default
**pr** marginal probability of a positive outcome
**pu0** probability of a positive outcome assuming that the
random effect is zero
**stdp** standard error of the linear prediction
-------------------------------------------------------------------------

*FE_statistic* Description
-------------------------------------------------------------------------
Main
__p__**c1** probability of a positive outcome conditional on one
positive outcome within group; the default
**pu0** probability of a positive outcome assuming that the
fixed effect is zero
**xb** linear prediction
**stdp** standard error of the linear prediction
-------------------------------------------------------------------------
The predicted probability for the fixed-effects model is conditional on
there being only one outcome per group. See **[R] clogit** for details.

*PA_statistic* Description
-------------------------------------------------------------------------
Main
**mu** probability of *depvar*; considers the **offset()**
**rate** probability of *depvar*
**xb** linear prediction
**stdp** standard error of the linear prediction
__sc__**ore** first derivative of the log likelihood with respect to
xb
-------------------------------------------------------------------------

These statistics are available both in and out of sample; type **predict**
*...* **if e(sample)** *...* if wanted only for the estimation sample.

__Menu for predict__

**Statistics > Postestimation**

__Description for predict__

**predict** creates a new variable containing predictions such as linear
predictions, probabilities, standard errors, and equation-level scores.

__Options for predict__

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

**xb** calculates the linear prediction. This is the default for the
random-effects model.

**pc1** calculates the predicted probability of a positive outcome
conditional on one positive outcome within group. This is the
default for the fixed-effects model.

**mu** and **rate** both calculate the predicted probability of *depvar*. **mu** takes
into account the **offset()**, and **rate** ignores those adjustments. **mu**
and **rate** are equivalent if you did not specify **offset()**. **mu** is the
default for the population-averaged model.

**pr** calculates the probability of a positive outcome that is marginal with
respect to the random effect, which means that the probability is
calculated by integrating the prediction function with respect to the
random effect over its entire support.

**pu0** calculates the probability of a positive outcome, assuming that the
fixed or random effect for that observation's panel is zero. This
may not be similar to the proportion of observed outcomes in the
group.

**stdp** calculates the standard error of the linear prediction.

**score** calculates the equation-level score.

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

__Syntax for margins__

**margins** [*marginlist*] [**,** *options*]

**margins** [*marginlist*] **,** __pr__**edict(***statistic *...**)** [__pr__**edict(***statistic *...**)**
...] [*options*]

Random-effects model

*statistic* Description
-------------------------------------------------------------------------
**pr** marginal probability of a positive outcome; the
default
**pu0** probability of a positive outcome assuming that the
random effect is zero
**xb** linear prediction
**stdp** not allowed with **margins**
-------------------------------------------------------------------------

Fixed-effects model

*statistic* Description
-------------------------------------------------------------------------
**pu0** probability of a positive outcome assuming that the
fixed effect is zero; the default
**xb** linear prediction
__p__**c1** not allowed with **margins**
**stdp** not allowed with **margins**
-------------------------------------------------------------------------

Population-averaged model

*statistic* Description
-------------------------------------------------------------------------
**mu** probability of *depvar*; considers the **offset()**
**rate** probability of *depvar*
**xb** linear prediction
**stdp** not allowed with **margins**
__sc__**ore** not allowed with **margins**
-------------------------------------------------------------------------

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

For the full syntax, see **[R] margins**.

__Menu for margins__

**Statistics > Postestimation**

__Description for margins__

**margins** estimates margins of response for linear predictions and
probabilities.

__Examples__

Setup
**. webuse union**

Fit random-effects model
**. xtlogit union age grade i.south**

Compute probability of positive outcome, assuming that random effect is
zero
**. predict prob, pu0**

Fit population-averaged model
**. xtlogit union age grade i.south, pa**

Compute predicted probability of **union**
**. predict unionpr, mu**

Compute average marginal effect of **age** on probability of **union**
**. margins, dydx(age)**