*! version 2.0.0 13nov2014
help str2d

Title

str2d -- Explained variation in survival analysis - Royston-Sauerbrei D measure

Syntax

str2d [, str2d_options]
:
survival_cmd
xvarlist
[if] [in]
[, survival_cmd_options]

str2d_options

adjust computes adjusted R2, taking into account model dimension

bootreps(#) computes a bootstrap confidence interval using # replications

exclude(varlist) excludes varlist from the linear predictor when assessing R2

modeldim(#) sets the dimension of the fitted model to #

nodots suppresses display of the bootstrap replication dots

randomness reports explained randomness (default is explained variation)

validate(varname) estimates the model in the subsample defined by the lower value
of varname and computes R2 in the subsample defined by the higher value of varname

survival_cmd_options options of survival_cmd

where

survival_cmd may be
stcox,
streg,
stpm (if installed), or
stpm2 (if installed).

You must have stset your data before using str2d.

Description

str2d computes Royston & Sauerbrei (2004)'s R2 statistic based on
the D measure of discrimination of proportional hazards, proportional
odds and probit models for censored survival data. The D measure is
available for all the above survival_cmd commands except
streg, distribution(gamma).

The model is defined by

. survival_cmd xvarlist [ , survival_cmd_options ]

See the validate() option for comments on out-of-sample prediction
and assessment of R2 in a "validation" or test sample.

IMPORTANT NOTE: For version 2.0.0 and upwards, str2d has
"colon command" syntax. The older syntax (up to and including version 1.2.3)
is no longer available. Also, str2ph has been withdrawn and is
no longer included in this package. It has been shown to be prone to bias
as censoring increases.

Options

adjust computes adjusted R2, taking into account the dimension
(i.e. number of covariates) of the model. This may be helpful when
R2 is low and/or the model is complex, since the expected value of R2 under
the null hypothesis that the outcome is unrelated to the covariates is
greater than zero and depends on the model dimension. Adjustment
attempts to eliminate this bias in R2 under the null hypothesis.
Since R2 calculated by out-of-sample prediction in a "validation"
sample does not require adjustment, the validate() option is
not permitted with adjust. See also the modeldim() option.

bootreps(#) with # > 0 computes a bootstrap confidence
interval for R2, using # bootstrap replications. A minimum reasonable
value of # is 1000, but a better number is 5000. Note that with
# = 5000, the computation may take quite some time. The default
value of # is 0, meaning no bootstrap CI is computed; in that case,
an analytic estimate of the SE of R2 is displayed, derived by the delta method
from the SE of D. See Royston & Sauerbrei (2004) for details of the SE of D.

exclude(varlist) deletes predictors in varlist from the linear
predictor before computing R2 and D. The point of this option is to
remove the effect of irrelevant or uninteresting structural or adjustment
variables, such as centre or region, from the discrimination of the model
of interest. Note that the model is NOT re-fitted without varlist; the
values of regression coefficients are retained.

modeldim(#) sets the dimension of the fitted model to #.
The default is for the dimension to equal the number
of terms in xvarlist. Some people believe that with stepwise
selection of variables, the correct figure to use for the model
dimension is the number of candidate predictors (or more generally,
with multiparameter predictors such as fractional polynomials functions,
the degrees of freedom). modeldim() has an effect only when
the adjust option is also applied.

nodots suppresses display of the replication dots
with bootstrap confidence interval estimation. By default, a single dot
character is displayed after each 100 replications.

randomness expresses R2 results as "explained randomness".
The default is "explained variation".

validate(varname) estimates the model in the
subsample defined by the low value of varname and computes
R2 in the subsample defined by the high value of varname.
These subsamples may be thought of as a training and a test set.
varname must have exactly two distinct values in the
estimation sample defined by xvarlist, if and in.
These two values are arbitrary. varname may be a string variable,
in which case lexicographic ordering is assumed. R2 is computed
according to the index (xb) predicted from
the training sample (low value of varname) into the test sample
(high value of varname). The index predicted on the test sample
is transformed to scaled normal scores and regression on the scores
is performed. The slope of this regression is
Royston & Sauerbrei (2004)'s D statistic. This step
is required to compute D and hence R2.

survival_cmd_options are options of survival_cmd.
Examples include distribution(weibull) for streg,
df(2) scale(hazard) for stpm and stpm2, and
strata(x1 x2) for stcox.

Examples

. webuse brcancer, clear

. stset rectime, failure(censrec) scale(365.24)

. str2d: stcox x4a x5e x6 hormon

. str2d, bootreps(500): stcox x4a x5e x6 hormon

. str2d: stpm2 x4a x5e x6 hormon, df(2) scale(hazard)

. str2d: streg x4a x5e x6 hormon, distribution(weibull)

. set seed 10101

. gen byte val = (runiform() < 0.5)

. str2d, validate(val): stcox x4a x5e x6 hormon

Author

Patrick Royston, MRC Clinical Trials Unit at UCL, London.

j.royston@ucl.ac.uk

References

B. Choodari-Oskooei, P. Royston and M. K. B. Parmar. 2012. A simulation study
of predictive ability measures in a survival model I:
Explained variation measures. Statistics in Medicine 31: 2627-2643.

J. O’Quigley, R. Xu and J. Stare. 2005.
Explained randomness in proportional hazards models.
Statistics in Medicine 24: 479-489.

P. Royston. 2006. Explained variation for survival models.
Stata Journal 6(1): 83-96.

P. Royston and W. Sauerbrei. 2004. A new measure of prognostic
separation in survival data. Statistics in Medicine 23: 723-748.

Also see

Online: help for stcox, streg;
stpm, stpm2 (if installed).