Stata 15 help for poisson_postestimation

[R] poisson postestimation -- Postestimation tools for poisson

Postestimation commands

The following postestimation command is of special interest after poisson:

Command Description ------------------------------------------------------------------------- estat gof goodness-of-fit test ------------------------------------------------------------------------- estat gof is not appropriate after 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 linktest link test for model specification * 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. forecast is also not appropriate with mi estimation results.

Syntax for predict

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

statistic Description ------------------------------------------------------------------------- Main n number of events; the default ir incidence rate pr(n) probability Pr(y = n) pr(a,b) probability Pr(a < y < b) xb linear prediction stdp standard error of the linear prediction score 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, 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)*exposure if exposure() was specified.

ir calculates the incidence rate exp(xb), which is the predicted number of events when exposure is 1. Specifying ir is equivalent to specifying n when neither offset() nor exposure() was specified when the model was fit.

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).

xb calculates the linear prediction, which is xb if neither offset() nor exposure() was specified; 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 xb + offset or xb + ln(exposure). Specifying predict ..., nooffset is equivalent to specifying predict ..., ir.

Syntax for margins

margins [marginlist] [, options]

margins [marginlist] , predict(statistic ...) [predict(statistic ...) ...] [options]

statistic Description ------------------------------------------------------------------------- n number of events; the default ir incidence rate pr(n) probability Pr(y = n) pr(a,b) probability Pr(a < y < b) xb linear prediction stdp not allowed with margins score 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, probabilities, and linear predictions.

Syntax for estat

estat gof

Menu for estat

Statistics > Postestimation

Description for estat

estat gof performs a goodness-of-fit test of the model. Both the deviance statistic and the Pearson statistic are reported. If the tests are significant, the Poisson regression model is inappropriate. Then you could try a negative binomial model; see [R] nbreg.

Examples

Setup . webuse dollhill3 . poisson deaths i.smokes i.agecat, exp(pyears)

Predict incidence rate . predict deathrate, ir

Estimate incidence rates and standard errors . margins agecat#smokes, predict(ir)

Plot estimates and confidence intervals . marginsplot

Goodness-of-fit tests . estat gof

Stored results

estat gof after poisson stores the following in r():

Scalars r(df) degrees of freedom (Pearson and deviance) r(chi2_p) chi-squared (Pearson) r(chi2_d) chi-squared (deviance) r(p_p) p-value for chi-squared test (Pearson) r(p_d) p-value for chi-squared test (deviance)


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index