Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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.

Value

a vector containing the value of D, R^2_D and the estimated standard error of D.

References

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

Examples

# 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)

survival

Survival Analysis

v3.2-11
LGPL (>= 2)
Authors
Terry M Therneau [aut, cre], Thomas Lumley [ctb, trl] (original S->R port and R maintainer until 2009), Atkinson Elizabeth [ctb], Crowson Cynthia [ctb]
Initial release
2021-04-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.