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

__Postestimation commands__

The following postestimation commands are of special interest after
**ivtobit**:

Command Description
-------------------------------------------------------------------------
**estat correlation** report the correlation matrix of the errors of
the dependent variable and the endogenous
variables
**estat covariance** report the covariance matrix of the errors of the
dependent variable and the endogenous variables
-------------------------------------------------------------------------
These commands are not appropriate after the two-step estimator or the
**svy** prefix.

The following standard postestimation commands are also available:

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; not available with
two-step estimator
**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
-------------------------------------------------------------------------
* **estat ic**, **forecast**, and **suest** are not appropriate after **ivtobit,**
**twostep**.
+ **forecast**, **hausman**, and **lrtest** are not appropriate with **svy** estimation
results.

__Syntax for predict__

After ML or twostep

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

After ML

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

*statistic* Description
-------------------------------------------------------------------------
Main
**xb** linear prediction; the default
**stdp** standard error of the linear prediction
**stdf** standard error of the forecast; not available with
two-step estimator
__p__**r(***a***,***b***)** Pr(*a* < y < *b*) accounting for endogeneity; not
available with two-step estimator
**e(***a***,***b***)** *E*(y | *a* < y < *b*) accounting for endogeneity; not
available with two-step estimator
__ys__**tar(***a***,***b***)** *E*(y*), y* = max{*a*,min(y,*b*)} accounting for
endogeneity; not available with two-step estimator
-------------------------------------------------------------------------
These statistics are available both in and out of sample; type **predict**
*...* **if e(sample)** *...* if wanted only for the estimation sample.
**stdf** is not allowed with **svy** estimation results.

where *a* and *b* may be numbers or variables; *a* missing (*a* __>__ **.**) means minus
infinity, and *b* missing (*b* __>__ **.**) means plus infinity; see missing.

__Menu for predict__

**Statistics > Postestimation**

__Description for predict__

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

__Options for predict__

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

**xb**, the default, calculates the linear prediction.

**stdp** calculates the standard error of the linear prediction. It 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.

**stdf** calculates the standard error of the forecast, which is the standard
error of the point prediction for 1 observation. It is commonly
referred to as the standard error of the future or forecast value.
By construction, the standard errors produced by **stdf** are always
larger than those produced by **stdp**; see *Methods and formulas* in **[R]**
**regress postestimation**. **stdf** is not available with the two-step
estimator.

**pr(***a***,***b***)** calculates Pr(*a* < y < *b* | z), the probability that y|z would be
observed in the interval (*a*,*b*) accounting for endogeneity.

*a* and *b* may be specified as numbers or variable names; *lb* and *ub* are
variable names;
**pr(20,30)** calculates Pr(20 < y < 30 | z);
**pr(***lb***,***ub***)** calculates Pr(*lb* < y < *ub* | z); and
**pr(20,***ub***)** calculates Pr(20 < y < *ub* | z).

*a* missing (*a* __>__ .) means minus infinity; **pr(.,30)** calculates
Pr(-infinity < y < 30 | z);
**pr(***lb***,30)** calculates Pr(-infinity < y < 30 |z) in observations for
which *lb* __>__ .
and calculates Pr(*lb* < y < 30 | z) elsewhere.

*b* missing (*b* __>__ .) means plus infinity; **pr(20,.)** calculates
Pr(+infinity > y > 20 | z);
**pr(20,***ub***)** calculates Pr(+infinity > y > 20 | z) in observations for
which *ub* __>__ .
and calculates Pr(20 < y < *ub* | z) elsewhere.

**pr(***a***,***b***)** is not available with the two-step estimator.

**e(***a***,***b***)** calculates *E*(y | *a* < y < *b*), the expected value of *y*|z conditional
on y|z being in the interval (*a*,*b*), meaning that *y*|z is truncated. *a*
and *b* are specified as they are for **pr()**. Endogeneity is accounted
for when calculating **e(***a***,***b***)**. **e(***a***,***b***)** is not available with the
two-step estimator.

**ystar(***a***,***b***)** calculates *E*(y*), where y* = *a* if z + d __<__ *a*, y* = *b* if
z + d __>__ *b*, and y* = z + d + u otherwise, meaning that y* is censored.
*a* and *b* are specified as they are for **pr()**. Endogeneity is accounted
for when calculating **ystar(***a***,***b***)**. **ystar(***a***,***b***)** is not available with
the two-step estimator.

**scores**, not available with **twostep**, calculates equation-level score
variables.

For models with one endogenous regressor, five new variables are
created.

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

The second new variable will contain the first derivative of the
log likelihood with respect to the reduced-form equation for the
endogenous regressor.

The third new variable will contain the first derivative of the
log likelihood with respect to alpha.

The fourth new variable will contain the first derivative of the
log likelihood with respect to ln(s).

The fifth new variable will contain the first derivative of the
log likelihood with respect to ln(v).

For models with p endogenous regressors, p + {(p + 1)(p + 2)}/2 + 1
new variables are created.

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

The second through (p + 1)th new variables will contain the first
derivatives of the log likelihood with respect to the
reduced-form equations for the endogenous variables in the order
they were specified when **ivtobit** was called.

The remaining score variables will contain the partial
derivatives of the log likelihood with respect to the
(p+1)(p+2)/2 ancillary parameters.

__Syntax for margins__

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

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

*statistic* Description
-------------------------------------------------------------------------
**xb** linear prediction; the default
__p__**r(***a***,***b***)** Pr(*a* < y < *b*) accounting for endogeneity; not
available with two-step estimator
**e(***a***,***b***)** *E*(y | *a* < y < *b*) accounting for endogeneity; not
available with two-step estimator
__ys__**tar(***a***,***b***)** *E*(y*), y* = max{*a*,min(y,*b*)} accounting for
endogeneity; not available with two-step estimator
**stdp** not allowed with **margins**
**stdf** 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,
probabilities, and expected values.

__Syntax for estat__

Correlation matrix

**estat** __cor__**relation** [**,** __bor__**der(***bspec***)** **left(***#***)** __for__**mat(***%fmt***)**]

Covariance matrix

**estat** __cov__**ariance** [**,** __bor__**der(***bspec***)** **left(***#***)** __for__**mat(***%fmt***)**]

__Menu for estat__

**Statistics > Postestimation**

__Description for estat__

**estat correlation** displays the correlation matrix of the errors of the
dependent variable and the endogenous variables.

**estat covariance** displays the covariance matrix of the errors of the
dependent variable and the endogenous variables.

**estat correlation** and **estat covariance** are not allowed after the **ivtobit**
two-step estimator.

__Options for estat__

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

**border(***bspec***)** sets border style of the matrix display. The default is
**border(all)**.

**left(***#***)** sets the left indent of the matrix display. The default is
**left(2)**.

**format(***%fmt***)** specifies the format for displaying the individual elements
of the matrix. The default is **format(%9.0g)**.

__Examples__

Setup
**. webuse laborsup**
**. ivtobit fem_inc fem_educ kids (other_inc = male_educ), ll**

Compute average marginal effects on expected income, conditional on it
being greater than 10 (thousand dollars)
**. margins, predict(e(10,.)) dydx(other_inc fem_educ kids)**

Estimate separately for women with 8, 12, and 16 years of education
**. margins, predict(e(10,.)) dydx(kids) at(fem_educ=(8(4)16))**

Plot most recent estimates and confidence intervals
**. marginsplot**