*! version 1.0.0 01jun2010

Title

Postestimation tools for stpreg

Introduction

The following postestimation commands are of special interest after the most
recently fit event-probability regression model using stpreg.

Postestimation commands

Command Description

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

hausman Hausman's specification test

lincom point estimates, standard errors, testing, and inference for linear combinations of coefficients

lrtest likelihood-ratio test

nlcom l point estimates, standard errors, testing, and inference for nonlinear combinations of coefficients

predict predictions of probabilities, odds function, hazard functions and other functions after stpreg

test Wald tests of simple and composite linear hypotheses

testnl Wald tests of nonlinear hypotheses

Syntax for predict

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

statistic

Main
* probability event-probability function

* hazard hazard function

* cumhazard cumulative hazard function

* survival survival function

* failure failure function

mata the user-defined [log] hazard function contains a Mata only function, see details

ci calculate confidence intervals

timevar(varname) time variable used for predictions (default _t)

at(vn # [vn # ...]) predict at values of specified covariates

zeros sets all covariates to zero (baseline prediction)

Subsidiary
level sets confidence level (default 95)

* Either probability, hazard, cumhazard, survival, or failure is required.

Description for predict

predict creates a new variable containing predictions such as probabilities, hazard function, cumulative hazard, baseline survivor, and failure function.

Options for predict

Main

probability calculates the predicted event-probabilities.

hazard calculates the predicted hazard.

cumhazard calculates the predicted cumulative hazard.

survival calculates the predicted survivor function.

failure calculates the predicted failure function (1-survival).

mata uses Mata to calculate the prediction, required when a Mata only function is included in the
user-defined [log] hazard function used to fit the model. ci is not available when mata is used.

ci calculates a confidence interval for the requested statistic and
stores the confidence limits in newvar_lci and
newvar_uci.

timevar(varname) defines the variable used as time in the predictions.
Default varname is _t. This is useful for large datasets where
for plotting purposes predictions are only needed for 200 observations for example.
Note: unless at() and/or zeros are specified, predictions are made at the covariate values for the first 200 rows of data.

at(varname # [ varname # ...]) requests that the covariates specified by
the listed varname(s) be set to the listed # values. For example,
at(x1 1 x3 50) would evaluate predictions at x1 = 1 and
x3 = 50. Variables not listed in at(), are set to their sample
values. Add option zeros to set all the other covariates to zero.

zeros sets all covariates to zero (baseline prediction). For
example, predict s0, survival zeros calculates the baseline
survival function. See also at().

Subsidiary

level(#) sets the confidence level; default is level(95)
or as set by set level.

Examples

Setup

webuse brcancer

stset rectime, failure(censrec = 1) scale(365.25)

Proportional log odds-model

stpreg hormon, df(2)

predict prob1, probability ci

twoway line prob1 _t if hormon==0, sort || line prob1 _t if hormon==1, sort

predict surv1, survival ci

twoway line surv1 _t if hormon==0, sort || line surv1 _t if hormon==1, sort