OXS: R2-type coefficients for Cox proportional hazards models

View source: R/surv_measures.R

OXSR Documentation

R2-type coefficients for Cox proportional hazards models


R2-type Coefficients for Cox proportional hazards models


OXS(Surv.rsp, lp, lp0)
Nagelk(Surv.rsp, lp, lp0)
XO(Surv.rsp, lp, lp0)



A Surv(.,.) object containing to the outcome of the test data.


The vector of predictors.


The vector of predictors obtained from the covariate-free null model.


The OXS, Nagelk and XO functions implement three types of R2 coefficients for right-censored time-to-event data: (a) The coefficient proposed by O'Quigley et al. (2005) (OXS), (b) the coefficient proposed by Nagelkerke (1991) (Nagelk) and (c) the coefficient proposed by Xu and O'Quigley (1999) (XO).

Because the OXS, Nagelk and XO functions assume that lp and lpnew were derived from a correctly specified Cox proportional hazards model, estimates obtained from these functions are only valid if the Cox model holds.


The estimated R2 coefficient.


Nagelkerke, N. J. D. (1991).
A note on a general definition of the coefficient of determination.
Biometrika 78, 691–692.

O'Quigley, J., R. Xu, and J. Stare (2005).
Explained randomness in proportional hazards models.
Statistics in Medicine 24, 479–489.

Xu, R. and J. O'Quigley (1999).
A measure of dependence for proportional hazards models.
Journal of Nonparametric Statistics 12, 83–107.

See Also

predErr, schemper, GHCI


TR <- ovarian[1:16,]
TE <- ovarian[17:26,]
train.fit  <- survival::coxph(survival::Surv(futime, fustat) ~ age,
                    x=TRUE, y=TRUE, method="breslow", data=TR)

model0 <- survival::coxph(survival::Surv(futime, fustat)~1, data=TR)
model1 <- survival::coxph(survival::Surv(futime, fustat)~age, data=TR)
f0 <- rep(0,nrow(TE))
f1 <- predict(model1, newdata=TE)               
Surv.res <- survival::Surv(TE$futime, TE$fustat)

OXS(Surv.res, f1, f0)
Nagelk(Surv.res, f1, f0)
XO(Surv.res, f1, f0)

survAUC documentation built on March 31, 2023, 11:50 p.m.

Related to OXS in survAUC...