*! version 1 25Jun2015
help strcs postestimation
also see: strcs

Title

[ST] strcs postestimation -- Post-estimation tools for strcs

Description

The following standard post-estimation commands are available:

command description

estat post estimation statistics

predict predictions, residuals etc

Syntax for predict

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

Note: in the table below, vn is an abbreviation for varname.

statistic

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

ci calculate confidence intervals

cumhazard cumulative hazard function

hazard hazard function

hdiff1(vn # [vn # ...]) 1st hazard function for difference in hazard functions

hdiff2(vn # [vn # ...]) 2nd hazard function for difference in hazard functions

hrnumerator(vn # [vn # ...]) numerator for (time-dependent) hazard ratio

hrdenominator(vn # [vn # ...]) denominator for (time-dependent) hazard ratio

nodes(#) specifies the number of nodes used in Gauss-Legendre quadrature numerical integration
when predicting the cumulative hazard and calculating the survival (default is 30)

per(#) express hazard rates (and differences) per # person years

sdiff1(vn # [vn # ...]) 1st survival curve for difference in survival functions

sdiff2(vn # [vn # ...]) 2nd survival curve for difference in survival functions

stdp standard error of predicted function

survival survival function

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

xb the linear predictor

xbnobaseline predicts the linear predictor, excluding the spline function

zeros sets all covariates to zero (baseline prediction)

Subsidiary
level(#) sets confidence level (default 95)

Statistics are available both in and out of sample; type
predict ... if e(sample) ... if wanted only for the
estimation sample.

Options for predict

Note that if a relative survival model has been fitted by use of the
bhazard() option then survival refers to relative
survival and hazard refers to excess hazard.

Main

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. This is a useful way to obtain out of sample predictions.
Note that if at() is used together with zeros all covariates not
listed in at() are set to zero. If at() is used without zeros
then all covariates not listed in at() are set to their sample
values. See also zeros.

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

cumhazard predicts the cumulative hazard function using the Gauss-Legendre
quadrature numerical integration method.

hazard predicts the hazard function.

hdiff1(varname # ...), hdiff2(varname # ...) predict
the difference in hazard functions with the first hazard function defined
by the covariate values listed for hdiff1() and the second by
those listed for hdiff2(). By default, covariates not specified
using either option are set to zero. Note that setting the remaining values
of the covariates to zero may not always be sensible. If # is set to
. then varname takes its observed values in the dataset.

Example: hdiff1(hormon 1) (without specifying hdiff2())
computes the difference in predicted hazard functions at hormon
= 1 compared with hormon = 0.

Example: hdiff1(hormon 2) hdiff2(hormon 1) computes the difference in
predicted hazard functions at hormon = 2 compared with hormon = 1.

Example: hdiff1(hormon 2 age 50) hdiff2(hormon 1 age 30)
computes the difference in predicted hazard functions at
hormon = 2 and age = 50 compared with hormon = 1
and age = 30.

hrdenominator(varname # ...) specifies the denominator of the hazard
ratio. By default, all covariates other than varname and any other
variables mentioned are set to zero. See cautionary note in hrnumerator.
If # is set to . then varname takes its observed values
in the dataset.

hrnumerator(varname # ...) predicts the (time-dependent) hazard ratio
with the numerator of the hazard ratio. By default, all covariates other than
varname and any other variables mentioned are set to zero. Note that
setting the remaining values of the covariates to zero may not always be
sensible. If # is set to . then varname takes
its observed values in the dataset.

nodes(#) specifies the number of nodes to be used when numerically integrating
the estimated hazard function using Gauss-Legendre quadrature. Numerical integration is required
when predicting the cumulative hazard and survival functions. The default number of nodes is 30.

per(#) express hazard rates and difference in hazard rates per # person years.

sdiff1(varname # ...), sdiff2(varname # ...) predict
the difference in survival curves with the first survival curve defined
by the covariate values listed for sdiff1() and the second by
those listed for sdiff2(). By default, covariates not specified
using either option are set to zero. Note that setting the remaining values
of the covariates to zero may not always be sensible. If # is set to
. then varname takes its observed values in the dataset.

Example: sdiff1(hormon 1) (without specifying sdiff2())
computes the difference in predicted survival curves at hormon
= 1 compared with hormon = 0.

Example: sdiff1(hormon 2) sdiff2(hormon 1) computes the difference in
predicted survival curves at hormon = 2 compared with hormon = 1.

Example: sdiff1(hormon 2 age 50) sdiff2(hormon 1 age 30)
computes the difference in predicted survival curves at
hormon = 2 and age = 50 compared with hormon = 1
and age = 30.

stdp calculates standard error of prediction and stores it in
newvar_se. Only available for the xb and
xbnobaseline options.

survival predicts the survival function.

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 that some caution should be taken when using this option as predictions may be
made at whatever covariate values are in the first 200 rows of data.
This can be avoided by using the at() option and/or the zeros option to
define the covariate patterns for which you require the predictions.

xb predicts the linear predictor, including the spline function.

xbnobaseline predicts the linear predictor, excluding the spline
function - i.e. only the time-fixed part of the model.

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 (help set level}.

Examples

Setup

webuse brcancer

stset rectime, failure(censrec = 1)

Proportional hazards model

strcs hormon, df(4)

predict h, hazard ci

predict s, survival ci

Time-dependent effects on cumulative hazard scale

strcs hormon, df(4) tvc(hormon) dftvc(3)

predict hr, hrnumerator(hormon 1) ci

predict survdiff, sdiff1(hormon 1) ci

predict hazarddiff, hdiff1(hormon 1) ci

Use of at() option

strcs hormon x1, df(4) tvc(hormon) dftvc(3)

predict s60h1, survival at(hormon 1 x1 60) ci

References

T. M-L. Andersson, P.W Dickman, S. Eloranta and P. C. Lambert. Estimating and modelling
cure in population-based cancer studies within the framework of flexible parametric survival
models. BMC Medical Research Methodology 2011;11:96.

M. J. Crowther and P. C. Lambert. A general framework for parametric survival analysis.
Statistics in Medicine 2014;33:5280-5297.

P. C. Lambert and P. Royston. Further development of flexible parametric
models for survival analysis. Stata Journal 2009;9:265-290.

C. P. Nelson, P. C. Lambert, I. B. Squire and D. R. Jones.
Flexible parametric models for relative survival, with application
in coronary heart disease. Statistics in Medicine 2007;26:5486-5498.

P. Royston and M. K. B. Parmar. Flexible proportional-hazards and
proportional-odds models for censored survival data, with application
to prognostic modelling and estimation of treatment effects.
Statistics in Medicine 2002;21:2175-2197.

P. Royston, P.C. Lambert. Flexible parametric survival analysis in Stata:
Beyond the Cox model StataPress, 2011

Also see

Online: [ST] strcs;