**[R] heckprobit postestimation** -- Postestimation tools for heckprobit

__Postestimation commands__

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

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
* **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
-------------------------------------------------------------------------
* **hausman** and **lrtest** are not appropriate with **svy** estimation results.

__Syntax for predict__

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

**predict** [*type*] {*stub**|*newvar_reg* *newvar_sel* *newvar_athrho*} [*if*] [*in*]**,**
__sc__**ores**

*statistic* Description
-------------------------------------------------------------------------
Main
__pm__**argin** Pr(*depvar*=1); the default
**p11** Pr(*depvar*=1, *depvar_s*=1)
**p10** Pr(*depvar*=1, *depvar_s*=0)
**p01** Pr(*depvar*=0, *depvar_s*=1)
**p00** Pr(*depvar*=0, *depvar_s*=0)
__ps__**el** Pr(*depvar_s*=1)
__pc__**ond** Pr(*depvar*=1 | *depvar_s*=1)
**xb** linear prediction
**stdp** standard error of the linear prediction
__xbs__**el** linear prediction for selection equation
__stdps__**el** standard error of the linear prediction for selection
equation
-------------------------------------------------------------------------

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
probabilities, linear predictions, and standard errors.

__Options for predict__

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

**pmargin**, the default, calculates the univariate (marginal) predicted
probability of success Pr(*depvar*=1).

**p11** calculates the bivariate predicted probability Pr(*depvar*=1,
*depvar_s*=1).

**p10** calculates the bivariate predicted probability Pr(*depvar*=1,
*depvar_s*=0).

**p01** calculates the bivariate predicted probability Pr(*depvar*=0,
*depvar_s*=1).

**p00** calculates the bivariate predicted probability Pr(*depvar*=0,
*depvar_s*=0).

**psel** calculates the univariate (marginal) predicted probability of
selection Pr(*depvar_s*=1).

**pcond** calculates the conditional (on selection) predicted probability of
success Pr(*depvar*=1 | *depvar_s*=1) = Pr(*depvar*=1,
*depvar_s*=1)/Pr(*depvar_s*=1).

**xb** calculates the probit linear prediction.

**stdp** calculates the standard error of the prediction, which can be
thought of as the standard error of the predicted expected value or
mean for the observation's covariate pattern. The standard error of
the prediction is also referred to as the standard error of the
fitted value.

**xbsel** calculates the linear prediction for the selection equation.

**stdpsel** calculates the standard error of the linear prediction for the
selection equation.

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

**scores** calculates equation-level score variables.

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

The second new variable will contain the derivative of the log
likelihood with respect to the selection equation.

The third new variable will contain the derivative of the log
likelihood with respect to the third equation (**athrho**).

__Syntax for margins__

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

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

*statistic* Description
-------------------------------------------------------------------------
__pm__**argin** Pr(*depvar*=1); the default
**p11** Pr(*depvar*=1, *depvar_s*=1)
**p10** Pr(*depvar*=1, *depvar_s*=0)
**p01** Pr(*depvar*=0, *depvar_s*=1)
**p00** Pr(*depvar*=0, *depvar_s*=0)
__ps__**el** Pr(*depvar_s*=1)
__pc__**ond** Pr(*depvar*=1 | *depvar_s*=1)
**xb** linear prediction
__xbs__**el** linear prediction for selection equation
**stdp** not allowed with **margins**
__stdps__**el** 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 probabilities and linear
predictions.

__Examples__

Setup
**. webuse school**

Fit probit model with sample selection
**. heckprobit private years logptax, sel(vote=years loginc logptax)**

Estimate marginal probability that **private** equals one
**. predict pmarg**

Compare to probit model with an **if** qualifier
**. probit private years if vote==1**

Calculated predicted probabilities
**. predict phat**