Learn R Programming

survival (version 3.2-11)

royston: Compute Royston's D for a Cox model

Description

Compute the D statistic and R^2 for a coxph model, proposed by Royston and Sauerbrei

Usage

royston(fit, newdata, ties = TRUE, adjust = FALSE)

Arguments

fit

a coxph fit

newdata

optional validation data set

ties

make a correction for ties in the risk score

adjust

adjust for possible overfitting

Value

a vector containing the value of D, \(R-squared\) and the estimated standard error of D.

Details

The adjustment is based on the ratio r= (number of events)/(number of coefficients). For models which have sufficient sample size (r>20) the adjustment will be small.

References

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

Examples

Run this code
# NOT RUN {
# one of the examples from the paper
pbc2 <- na.omit(pbc)  # no missing values
cfit <- coxph(Surv(time, status==2) ~ age + log(bili) + edema + albumin +
                   stage + copper, data=pbc2, ties="breslow")
royston(cfit)
# }

Run the code above in your browser using DataLab