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

__Postestimation commands__

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

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
**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** is not appropriate after **reg3, 2sls**.

__Syntax for predict__

**predict** [*type*] *newvar* [*if*] [*in*] [**,** __eq__**uation(***eqno*[**,***eqno*]**)** *statistic*]

*statistic* Description
-------------------------------------------------------------------------
Main
**xb** linear prediction; the default
**stdp** standard error of the linear prediction
__r__**esiduals** residuals
__d__**ifference** difference between the linear predictions of two
equations
**stddp** standard error of the difference in linear predictions
-------------------------------------------------------------------------
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, standard errors, residuals, and differences between the
linear predictions of two equations.

__Options for predict__

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

**equation(***eqno*[**,***eqno*]**)** specifies to which equation you are referring.

**equation()** is filled in with one *eqno* for the **xb**, **stdp**, and **residuals**
options. **equation(#1)** would mean the calculation is to be made for
the first equation, **equation(#2)** would mean the second, and so on.
You could also refer to the equations by their names.
**equation(income)** would refer to the equation named income and
**equation(hours)** to the equation named hours.

If you do not specify **equation()**, results are the same as if you
specified **equation(#1)**.

**difference** and **stddp** refer to between-equation concepts. To use
these options, you must specify two equations, for example,
**equation(#1,#2)** or **equation(income,hours)**. When two equations must
be specified, **equation()** is required.

**xb**, the default, calculates the linear prediction (fitted values) -- the
prediction of xb for the specified equation.

**stdp** calculates the standard error of the prediction for the specified
equation. 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.

**residuals** calculates the residuals.

**difference** calculates the difference between the linear predictions of
two equations in the system. With **equation(#1,#2)**, **difference**
computes the prediction of **equation(#1)** minus the prediction of
**equation(#2)**.

**stddp** is allowed only after you have previously fit a multiple-equation
model. The standard error of the difference in linear predictions
(x1b - x2b) between equations 1 and 2 is calculated.

For more information on using **predict** after multiple-equation estimation
commands, see **[R] predict**.

__Syntax for margins__

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

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

*statistic* Description
-------------------------------------------------------------------------
default linear predictions for each equation
**xb** linear prediction for a specified equation
__d__**ifference** difference between the linear predictions of two
equations
**stdp** not allowed with **margins**
__r__**esiduals** not allowed with **margins**
__stdd__**p** not allowed with **margins**
-------------------------------------------------------------------------
**xb** defaults to the first equation.

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
differences between the linear predictions of two equations.

__Examples__

Setup
**. webuse supDem**
**. global demand "(qDemand: quantity price pcompete income)"**
**. global supply "(qSupply: quantity price praw)"**
**. reg3 $demand $supply, endog(price)**
**. summarize pcompete, meanonly**
**. replace pcompete = r(mean)**
**. summarize income, meanonly**
**. replace income = r(mean)**
**. summarize praw, meanonly**
**. replace praw = r(mean)**

Predict demand
**. predict demand, equation(qDemand)**

Predict supply
**. predict supply, equation(qSupply)**