**[FMM] fmm postestimation** -- Postestimation tools for fmm

__Postestimation commands__

The following postestimation commands are of special interest after
estimation with **fmm**:

Command Description
-------------------------------------------------------------------------
**estat eform** display exponentiated parameters
**estat lcmean** latent class marginal means
**estat lcprob** latent class marginal probabilities
-------------------------------------------------------------------------

The following standard postestimation commands are also available:

Command Description
-------------------------------------------------------------------------
**contrast** contrasts and linear hypothesis tests
**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
* **hausman** Hausman's specification test
**lincom** linear combination of parameters
* **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
-------------------------------------------------------------------------
* **hausman** and **lrtest** are not appropriate with **svy** estimation results.

Postestimation commands such **lincom** and **nlcom** require referencing
estimated parameter values, which are accessible via **_b[***name***]**. To find
out what the names are, type **fmm,** **coeflegend**.

__Syntax for predict__

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

*statistic* Description
-------------------------------------------------------------------------
Main
**mu** expected value of *depvar*; the default
**eta** linear prediction of *depvar*
__den__**sity** density function at *depvar*
__dist__**ribution** distribution function at *depvar*
__surv__**ival** survivor function at *depvar*
**classpr** latent class probability
__classpost__**eriorpr** posterior latent class probability
__sc__**ore** first derivative of the log likelihood with respect
to the parameters
-------------------------------------------------------------------------

*options* Description
-------------------------------------------------------------------------
Main
__marg__**inal** compute *statistic* marginally with respect to the
latent classes
__pmarg__**inal** compute **mu** marginally with respect to the posterior
latent class probabilities
__nooff__**set** make calculation ignoring offset or exposure
* __o__**utcome(***depvar* [*#*]**)** specify observed response variable (default all)
**class(***#***)** specify latent class (default all)
-------------------------------------------------------------------------
***outcome(***depvar #***)** is allowed only if *depvar* is from **mlogit**, **ologit**, or
**oprobit**.
**outcome(***depvar #***)** may also be specified as **outcome(***#***.***depvar***)** or
**outcome(***depvar* **#***#***)**.
**outcome(***depvar* **#3)** means the third outcome value. **outcome(***depvar* **#3)**
would mean the same as **outcome(***depvar***4)** if outcomes were 1, 3, and 4.

__Menu for predict__

**Statistics > Postestimation**

__Description for predict__

**predict** after **fmm** creates new variables containing predictions such as
means, probabilities, linear predictions, densities, or latent class
probabilities.

__Options for predict__

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

**mu**, the default, calculates the expected value of the outcomes.

**eta** calculates the fitted linear prediction.

**density** calculates the density function. This prediction is computed
using the current values of the observed variables, including the
dependent variable.

**distribution** calculates the distribution function. This prediction is
computed using the current values of the observed variables,
including the dependent variable. This option is not allowed for
**mlogit** outcomes.

**survival** calculates the survivor function. This prediction is computed
using the current values of the observed variables, including the
dependent variable. This option is allowed only for **streg** outcomes.

**classpr** calculates predicted probabilities for each latent class.

**classposteriorpr** calculates predicted posterior probabilities for each
latent class. The posterior probabilities are a function of the
latent-class predictors and the fitted outcome densities.

**scores** calculates the scores for each coefficient in **e(b)**. This option
requires a new variable list of length equal to the number of columns
in **e(b)**. Otherwise, use *stub****** to have **predict** generate enumerated
variables with prefix *stub*.

**marginal** specifies that the prediction be computed marginally with
respect to the latent classes. The marginal prediction is computed
by combining the class specific predictions using the latent-class
probabilities.

This option is allowed only with **mu** and **density**.

**pmarginal** specifies that the prediction is computed by combining the
class specific expected values using the posterior latent-class
probabilities.

This option is allowed only with **mu**.

**nooffset** is relevant only if option **offset()** or **exposure()** was specified
at estimation time. **nooffset** specifies that **offset()** or **exposure()**
be ignored, which produces predictions as if all subjects had equal
exposure.

**outcome(***depvar* [*#*]**)** specifies the *depvar* for which predictions should be
calculated. Predictions for all observed response variables are
computed by default. Most models have only one *depvar*. If *depvar* is
an **mlogit**, **ologit**, or **oprobit** outcome, then *#* optionally specifies
which outcome level to predict. The default is the first level.

**class(***#***)** specifies that predictions for latent class *#* be calculated.
Predictions for all latent classes are computed by default.

__Syntax for margins__

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

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

*statistic* Description
-------------------------------------------------------------------------
default calculate expected values for each *depvar*
**mu** calculate expected value of *depvar*
**eta** calculate expected value of linear prediction of
*depvar*
**classpr** calculate latent class prior probabilities
__den__**sity** not allowed with **margins**
__dist__**ribution** not allowed with **margins**
__surv__**ival** not allowed with **margins**
__classpost__**eriorpr** not allowed with **margins**
__sc__**ore** not allowed with **margins**
-------------------------------------------------------------------------
**mu** defaults to the first *depvar* if option **outcome()** is not specified. If
*depvar* is **mlogit**, **ologit**, or **oprobit**, the default is the first level of
the outcome. The default is the first latent class if **class()** is not
specified.
**eta** defaults to the first *depvar* if option **outcome()** is not specified.
If *depvar* is **mlogit**, the default is the first level of the outcome.
**classpr** defaults to the first latent class if option **class()** is not
specified.
**predict**'s option **marginal** is assumed if **predict**'s option **class()** is not
specified.

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 outcome means, outcome
probabilities, and latent-class probabilities.

__Remarks and examples__

For examples using **estimates stats** to compare models based on Akaike
information criterion and Bayesian information criterion, see **[FMM]**
**example 1a**, **[FMM] example 1b**, and **[FMM] example 1d**.

For examples using **estat lcprob** to obtain marginal latent class
probabilities and **estat lcmean** to obtain marginal predicted means, see
**[FMM] example 2** and **[FMM] example 3**.

For examples using **test** and **contrast** to test equality of coefficients
across classes, see **[FMM] example 1c**.

For examples using **predict**, see **[FMM] example 2**, **[FMM] example 3**, and
**[FMM] example 4**.