------------------------------------------------------------------------------- help forstr2ph,str2dPatrick Royston -------------------------------------------------------------------------------

Explained variation in survival analysis

str2phsurvival_cmd[varlist] [if] [in] [,adjustbootreps(#)calibratedenominatornodotsoffset(varname)randomnessvalidate(varname)survival_cmd_options]

str2dsurvival_cmdvarlist[if] [in] [,adjustbootreps(#)randomnessvalidate(varname)survival_cmd_options]

where

survival_cmdmay be stcox, streg, or stpm (if installed).You must have

stsetyour data before usingstr2phorstr2d.

Description

str2phcomputes Royston (2006)'s modification of O'Quigley, Xu & Stare's (2005) modification of Nagelkerke's (1991) R-squared (R≤) statistic (a.k.a. coefficient of determination, proportion of explained variation) for proportional hazards (PH) models for censored survival data.str2phwill also give sensible results in non-PH survival models supported bystregandstpm; see Royston (2006) for further information.

str2dcomputes Royston & Sauerbrei (2004)'s R≤ statistic based on their index of discrimination (D) for proportional hazards, proportional odds and probit models for censored survival data. The D measure is available for allsurvival_cmds exceptstreg, distribution(gamma).The model is defined by

.survival_cmdvarlist[,survival_cmd_options]

See the

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

Options

adjustcomputes adjusted R≤, taking into account the dimension (i.e. number of covariates) of the model. This may be helpful when R≤ is low and/or the model is very complex, since the expected value of R≤ 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 R≤ under the null hypothesis. Since R≤ calculated by out-of-sample prediction in a "validation" sample does not require adjustment, thevalidate()option is not permitted withadjust.

bootreps(#)with#> 0 computes a bootstrap confidence interval for R≤, 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. With#= 0 instr2d, an analytic estimate of the SE of R≤ is displayed, derived by the delta method from the SE of D (see Royston & Sauerbrei (2004) for details of the SE of D).

calibrate(for use only withstr2ph..., validate()) forces the survival regression to be re-estimated in the test sample on the index predicted fromvarlistin the training sample. The default is to offset the predicted index and calculate R≤ via the likelihood of that model. Regression on the index amounts to calibration of the model in the test sample and may noticeably increase the R≤ value. See also thevalidate()option.

denominatorchanges the denominator for the model chisquare statistic from k (the number of events) to n*(k/n)^alpha, where n is the sample size and alpha is approximately 5/6. A better value of alpha is required; this is work in progress. The effect of this option is to reduce the variation explained, particularly when the number of events is small.

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

offset(varname)offsetsvarnamefrom the linear predictor. Note thatoffset(varname)without a mainvarlistis permitted. This allows the evaluation of a predictor 'from outside'.

randomnessprevents conversion of the modified Nagelkerke index of determination from explained randomness to explained variation. The reported R≤ is then interpretable, at least in PH models, as explained randomness.

validate(varname)estimates the model in the subsample defined by the low value ofvarnameand computes R≤ in the subsample defined by the high value ofvarname. These subsamples may be thought of as a training and a test set.varnamemust have exactly two distinct values in the estimation sample defined byvarlistandifandin. These two values are arbitrary.varnamemay be a string variable, in which case lexicographic ordering is assumed. R≤ is computed according to the index (xb) predicted from the training sample (low value ofvarname) into the test sample (high value ofvarname). Withstr2ph, there is a choice between refitting the index in the test sample, or offsetting the index there (see thecalibrateoption). Withstr2d, 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 R≤. Thecalibrateoption is not relevant to the D method, hence is not available withstr2d.

survival_cmd_optionsare options ofsurvival_cmd. Examples includedistribution(weibull)forstreg,df(2) scale(hazard)forstpm, andstrata(x1 x2)forstcox.

Examples

. str2ph stcox x1 x2 x3. str2ph stcox x1-x20, adjust bootreps(1000). str2ph stcox x1-x20, validate(tt) bootreps(1000). str2ph stcox x1-x20, validate(tt) calibrate bootreps(1000). str2ph streg x1 x2 x3, distribution(weibull). str2ph stpm x1 x2 x3, scale(hazard) df(2). str2ph stcox, offset(index)

. str2d stcox x1 x2 x3. str2d stcox x1 x2 x3, validate(tt). str2d streg x1 x2 x3, distribution(llogistic). str2d stpm x1 x2 x3 if a==1, scale(odds) df(2) validate(tt)

AuthorPatrick Royston, MRC Clinical Trials Unit, London. patrick.royston@ctu.mrc.ac.uk

ReferencesN. J. D. Nagelkerke. 1991. A note on a general definition of the coefficient of determination. Biometrika 78: 691-692.

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.

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

Also seeOnline: help for stcox, streg; stpm if installed.