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

__Postestimation commands__

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

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

__Syntax for predict__

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

*statistic* Description
-------------------------------------------------------------------------
Main
**n** number of events; the default
**ir** incidence rate
**cm** conditional mean, E(y | ll < y < ul)
**pr(***n***)** probability Pr(y = n)
**pr(***a***,***b***)** probability Pr(a __<__ y __<__ b)
**cpr(***n***)** conditional probability Pr(y = n | ll < y < ul)
**cpr(***a***,***b***)** conditional probability Pr(a __<__ y __<__ b | ll < y < ul)
**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 numbers of
events, incidence rates, conditional means, probabilities, conditional
probabilities, linear predictions, standard errors, and equation-level
scores.

__Options for predict__

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

**n**, the default, calculates the predicted number of events, which is
exp(xb) if neither **offset()** nor **exposure()** was specified when the
model was fit; exp(xb + offset) if **offset()** was specified; or
exp(xb) x exposure if **exposure()** was specified.

**ir** calculates the incidence rate exp(xb), which is the predicted number
of events when exposure is 1. This is equivalent to specifying both
the **n** and the **nooffset** options.

**cm** calculates the conditional mean, E(y|ll < y < ul), where ll is the
left-truncation point specified at estimation and ul is the
right-truncation point specified at estimation.

**pr(***n***)** calculates the probability Pr(y = n), where n is a nonnegative
integer that may be specified as a number or a variable.

**pr(***a***,***b***)** calculates the probability Pr(a __<__ y __<__ b), where a and b are
nonnegative integers that may be specified as numbers or variables;

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

**pr(.,***b***)** produces a syntax error. A missing value in an observation
of the variable *a* causes a missing value in that observation for
**pr(***a***,***b***)**.

**cpr(***n***)** calculates the conditional probability Pr(y = n|ll < y < ul),
where n is a nonnegative integer that may be specified as a number or
a variable. ll and ul are as defined in **cm**.

**cpr(***a***,***b***)** calculates the conditional probability Pr(a __<__ y __<__ b | ll < y <
ul), where a and b are as defined in {opt pr(a,b)} with the
additional restrictions that a > ll and b < ul. ll and ul are as
defined in **cm**.

**xb** calculates the linear prediction, which is xb if neither **offset()** nor
**exposure()** was specified when the model was fit; xb + offset if
**offset()** was specified; or xb + ln(exposure) if **exposure()** was
specified; see **nooffset** below.

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

**score** calculates the equation-level score, the derivative of the log
likelihood with respect to the linear prediction.

**nooffset** is relevant only if you specified **offset()** or **exposure()** when
you fit the model. It modifies the calculations made by **predict** so
that they ignore the offset or exposure variable; the linear
prediction is treated as xb rather than as xb + offset or
xb + ln(exposure). Specifying **predict** ...**, nooffset** is equivalent to
specifying **predict** ...**, ir**.

__Syntax for margins__

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

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

*statistic* Description
-------------------------------------------------------------------------
**n** number of events; the default
**ir** incidence rate
**cm** conditional mean, E(y | ll < y < ul)
**pr(***n***)** probability Pr(y = n)
**pr(***a***,***b***)** probability Pr(a __<__ y __<__ b)
**cpr(***n***)** conditional probability Pr(y = n | ll < y < ul)
**cpr(***a***,***b***)** conditional probability Pr(a __<__ y __<__ b | ll < y < ul)
**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 numbers of events, incidence
rates, conditional means, probabilities, conditional probabilities, and
linear predictions.

__Examples__

Setup
**. webuse runshoes**
**. replace shoes = . if shoes<4**

Fit truncated Poisson regression
**. tpoisson shoes distance male age, ll(3)**

Predict the number of pairs of shoes purchased
**. predict shoehat, n**

Predict the number of shoes purchased, conditional on each person having
bought more than 3 pairs of shoes
**. predict shoecondhat, cm**

Predict the probability each person has 1-3 pairs of shoes
**. predict p, pr(1,3)**

Predict the probability each person has 6 or more pairs of shoes given
that they have more than 3 pairs of shoes
**. predict p2, cpr(6,.)**