Package 'survAUC'

Title: Estimators of Prediction Accuracy for Time-to-Event Data
Description: Provides a variety of functions to estimate time-dependent true/false positive rates and AUC curves from a set of censored survival data.
Authors: Sergej Potapov [aut], Werner Adler [aut], Matthias Schmid [aut], Frederic Bertrand [cre, aut]
Maintainer: Frederic Bertrand <[email protected]>
License: GPL-2
Version: 1.3-0
Built: 2024-11-01 11:22:07 UTC
Source: https://github.com/fbertran/survauc

Help Index


AUC estimator proposed by Chambless and Diao

Description

Chambless and Diao's estimator of cumulative/dynamic AUC for right-censored time-to-event data

Usage

AUC.cd(Surv.rsp, Surv.rsp.new = NULL, lp, lpnew, times)

Arguments

Surv.rsp

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

Surv.rsp.new

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

lp

The vector of predictors estimated from the training data.

lpnew

The vector of predictors obtained from the test data.

times

A vector of time points at which to evaluate AUC.

Details

This function implements the estimator of cumulative/dynamic AUC proposed in Section 3.3 of Chambless and Diao (2006). In contrast to the general form of Chambless and Diao's estimator, AUC.cd is restricted to Cox regression. Specifically, it is assumed that lp and lpnew are the predictors of a Cox proportional hazards model. Estimates obtained from AUC.cd are valid as long as the Cox model is specified correctly. The iauc summary measure is given by the integral of AUC on [0, max(times)] (weighted by the estimated probability density of the time-to-event outcome).

Note that the recursive estimators proposed in Sections 3.1 and 3.2 of Chambless and Diao (2006) are not implemented in the survAUC package.

Value

AUC.cd returns an object of class survAUC. Specifically, AUC.cd returns a list with the following components:

auc

The cumulative/dynamic AUC estimates (evaluated at times).

times

The vector of time points at which AUC is evaluated.

iauc

The summary measure of AUC.

References

Chambless, L. E. and G. Diao (2006).
Estimation of time-dependent area under the ROC curve for long-term risk prediction.
Statistics in Medicine 25, 3474–3486.

See Also

AUC.uno, AUC.sh, AUC.hc, IntAUC

Examples

data(cancer,package="survival")
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)

lp <- predict(train.fit)
lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)
times <- seq(10, 1000, 10)                  

AUC_CD <- AUC.cd(Surv.rsp, Surv.rsp.new, lp, lpnew, times)

AUC estimator proposed by Hung and Chiang

Description

Hung and Chiang's estimator of cumulative/dynamic AUC for right-censored time-to-event data

Usage

AUC.hc(Surv.rsp, Surv.rsp.new, lpnew, times)

Arguments

Surv.rsp

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

Surv.rsp.new

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

lpnew

The vector of predictors obtained from the test data.

times

A vector of time points at which to evaluate AUC.

Details

This function implements the estimator of cumulative/dynamic AUC proposed by Hung and Chiang (2010). The estimator is based on inverse-probability-of-censoring weights and does not assume a specific working model for deriving the predictor lpnew. It is assumed, however, that there is a one-to-one relationship between the predictor and the expected survival times conditional on the predictor. The iauc summary measure is given by the integral of AUC on [0, max(times)] (weighted by the estimated probability density of the time-to-event outcome).

Note that the estimator implemented in AUC.hc is restricted to situations where the random censoring assumption holds (formula (4) in Hung and Chiang 2010).

Value

AUC.hc returns an object of class survAUC. Specifically, AUC.hc returns a list with the following components:

auc

The cumulative/dynamic AUC estimates (evaluated at times).

times

The vector of time points at which AUC is evaluated.

iauc

The summary measure of AUC.

References

Hung, H. and C.-T. Chiang (2010).
Estimation methods for time-dependent AUC models with survival data.
Canadian Journal of Statistics 38, 8–26.

See Also

AUC.uno, AUC.sh, AUC.cd, IntAUC

Examples

data(cancer,package="survival")
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)

lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)
times <- seq(10, 1000, 10)                  

AUC_hc <- AUC.hc(Surv.rsp, Surv.rsp.new, lpnew, times)
AUC_hc

AUC estimator proposed by Song and Zhou

Description

Song and Zhou's estimators of AUC for right-censored time-to-event data

Usage

AUC.sh(Surv.rsp, Surv.rsp.new=NULL, lp, lpnew, times, 
		type="incident", savesensspec=FALSE)
sens.sh(Surv.rsp, lp, lpnew, times, type="incident")
spec.sh(Surv.rsp, lp, lpnew, times)

Arguments

Surv.rsp

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

Surv.rsp.new

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

lp

The vector of predictors estimated from the training data.

lpnew

The vector of predictors obtained from the test data.

times

A vector of time points at which to evaluate AUC.

type

A string defining the type of true positive rate (TPR): "incident" refers to incident TPR , "cumulative" refers to cumulative TPR.

savesensspec

A logical specifying whether sensitivities and specificities should be saved.

Details

The sens.sh and spec.sh functions implement the estimators of time-dependent true and false positive rates proposed by Song and Zhou (2008).

The AUC.sh function implements the estimators of cumulative/dynamic and incident/dynamic AUC proposed by Song and Zhou (2008). These estimators are given by the areas under the time-dependent ROC curves estimated by sens.sh and spec.sh. In case of cumulative/dynamic AUC, the iauc summary measure is given by the integral of AUC on [0, max(times)] (weighted by the estimated probability density of the time-to-event outcome). In case of incident/dynamic AUC, iauc is given by the integral of AUC on [0, max(times)] (weighted by 2 times the product of the estimated probability density and the estimated survival function of the time-to-event outcome).

The results obtained from spec.sh, spec.sh and AUC.sh are valid as long as lp and lpnew are the predictors of a correctly specified Cox proportional hazards model. In this case, the estimators remain valid even if the censoring times depend on the values of the predictors.

Value

AUC.sh returns an object of class survAUC. Specifically, AUC.sh returns a list with the following components:

auc

The cumulative/dynamic or incident/dynamic AUC estimates (evaluated at times).

times

The vector of time points at which AUC is evaluated.

iauc

The summary measure of AUC.

sens.sh and spec.sh return matrices of dimensions times x lpnew + 1. The elements of these matrices are the sensitivity and specificity estimates for each threshold of lpnew and for each time point specified in times.

References

Song, X. and X.-H. Zhou (2008).
A semiparametric approach for the covariate specific ROC curve with survival outcome.
Statistica Sinica 18, 947–965.

See Also

AUC.uno, AUC.cd, AUC.hc, GHCI, IntAUC

Examples

data(cancer,package="survival")
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)

lp <- predict(train.fit)
lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)
times <- seq(10, 1000, 10)                  

AUC_sh <- AUC.sh(Surv.rsp, Surv.rsp.new, lp, lpnew, times)
names(AUC_sh)
AUC_sh$iauc

AUC estimator proposed by Uno et al.

Description

Uno's estimator of cumulative/dynamic AUC for right-censored time-to-event data

Usage

AUC.uno(Surv.rsp, Surv.rsp.new, lpnew, times, savesensspec=FALSE)
sens.uno(Surv.rsp, Surv.rsp.new, lpnew, times)
spec.uno(Surv.rsp.new, lpnew, times)

Arguments

Surv.rsp

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

Surv.rsp.new

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

lpnew

The vector of predictors obtained from the test data.

times

A vector of time points at which to evaluate AUC.

savesensspec

A logical specifying whether sensitivities and specificities should be saved.

Details

The sens.uno and spec.uno functions implement the estimators of time-dependent true and false positive rates proposed in Section 5.1 of Uno et al. (2007).

The AUC.uno function implements the estimator of cumulative/dynamic AUC that is based on the TPR and FPR estimators proposed by Uno et al. (2007). It is given by the area(s) under the time-dependent ROC curve(s) estimated by sens.sh and spec.sh. The iauc summary measure is given by the integral of AUC on [0, max(times)] (weighted by the estimated probability density of the time-to-event outcome).

Uno's estimators are based on inverse-probability-of-censoring weights and do not assume a specific working model for deriving the predictor lpnew. It is assumed, however, that there is a one-to-one relationship between the predictor and the expected survival times conditional on the predictor. Note that the estimators implemented in sens.uno, spec.uno and AUC.uno are restricted to situations where the random censoring assumption holds.

Value

AUC.uno returns an object of class survAUC. Specifically, AUC.uno returns a list with the following components:

auc

The cumulative/dynamic AUC estimates (evaluated at times).

times

The vector of time points at which AUC is evaluated.

iauc

The summary measure of AUC.

sens.uno and spec.uno return matrices of dimensions times x (lpnew + 1). The elements of these matrices are the sensitivity and specificity estimates for each threshold of lpnew and for each time point specified in times.

References

Uno, H., T. Cai, L. Tian, and L. J. Wei (2007).
Evaluating prediction rules for t-year survivors with censored regression models.
Journal of the American Statistical Association 102, 527–537.

See Also

AUC.cd, AUC.sh, AUC.hc, IntAUC

Examples

data(cancer,package="survival")
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)

lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)
times <- seq(10, 1000, 10)                  

AUC_Uno <- AUC.uno(Surv.rsp, Surv.rsp.new, lpnew, times)
names(AUC_Uno)
AUC_Uno$iauc

C-statistic by Begg et al.

Description

C-statistic by Begg et al.

Usage

BeggC(Surv.rsp, Surv.rsp.new, lp, lpnew)

Arguments

Surv.rsp

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

Surv.rsp.new

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

lp

The vector of predictors estimated from the training data.

lpnew

The vector of predictors obtained from the test data.

Details

This function implements the C-statistic proposed by Begg et al. (2000). It has the same interpretation as Harrell's C for survival data (implemented in the rcorr.cens function of the Hmisc package). BeggC is restricted to Cox regression. Specifically, it is assumed that lp and lpnew are the predictors of a Cox proportional hazards model. Estimates obtained from BeggC are valid as long as the Cox model is specified correctly.

Value

The estimated C-statistic.

References

Begg, B. C., L. D. Craemer, E. S. Venkatraman and J. Rosai (2000).
Comparing tumor staging and grading systems: a case study and a review of the issues, using thymoma as a model.
Statistics in Medicine 19, 1997–2014.

See Also

UnoC, GHCI, AUC.sh, IntAUC

Examples

data(cancer,package="survival")
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)

lp <- predict(train.fit)
lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)              

Cstat <- BeggC(Surv.rsp, Surv.rsp.new, lp, lpnew)
Cstat

Gonen and Heller's Concordance Index for Cox models

Description

Gonen and Heller's Concordance Index for Cox proportional hazards models

Usage

GHCI(lpnew)

Arguments

lpnew

The vector of predictors obtained from the test data.

Details

This function implements the concordance probability estimator proposed by Gonen and Heller (2005). It has the same interpretation as Harrell's C for survival data (implemented in the rcorr.cens function of the Hmisc package).

The results obtained from GHCI are valid as long as lpnew is the predictor of a correctly specified Cox proportional hazards model. In this case, the estimator remains valid even if the censoring times depend on the values of the predictor.

Note that the smoothed version of GHCI, which is proposed in Section 3 of Gonen and Heller (2005), is not implemented in R package survAUC.

Value

A length-one numeric vector containing the concordance probability estimate.

References

Harrell, F. E., R. M. Califf, D. B. Pryor, K. L. Lee and R. A. Rosati (1982).
Evaluating the yield of medical tests.
Journal of the American Medical Association 247, 2543–2546.

Harrell, F. E., K. L. Lee, R. M. Califf, D. B. Pryor and R. A. Rosati (1984).
Regression modeling strategies for improved prognostic prediction.
Statistics in Medicine 3, 143–152.

Gonen, M. and G. Heller (2005).
Concordance probability and discriminatory power in proportional hazards regression.
Biometrika 92, 965–970.

See Also

AUC.sh, IntAUC

Examples

data(cancer,package="survival")
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)

lpnew <- predict(train.fit, newdata=TE)
                 
GHCI(lpnew)

Integration of time-dependent AUC curves

Description

Compute summary measures of a time-dependent AUC curve

Usage

IntAUC(AUC, times, S, tmax, auc.type="cumulative")

Arguments

AUC

A vector of AUCs.

times

The vector of time points corresponding to AUC.

S

A vector of survival probabilities corresponding to times.

tmax

A number specifying the upper limit of the time range for which to compute the summary measure.

auc.type

A string defining the type of AUC. 'cumulative' refers to cumulative/dynamic AUC, 'incident' refers to incident/dynamic AUC.

Details

This function calculates the integral under a time-dependent AUC curve (“IAUC” measure) using the integration limits [0, tmax]. The values of the AUC curve are specified via the AUC argument.

In case auc.type = "cumulative" (cumulative/dynamic IAUC), the values of AUC are weighted by the estimated probability density of the time-to-event outcome. In case auc.type = "incident" (incident/dynamic IAUC), the values of AUC are weighted by 2 times the product of the estimated probability density and the (estimated) survival function of the time-to-event outcome. The survival function has to be specified via the S argument.

As shown by Heagerty and Zheng (2005), the incident/dynamic version of IAUC can be interpreted as a global concordance index measuring the probability that observations with a large predictor value have a shorter survival time than observations with a small predictor value. The incident/dynamic version of IAUC has the same interpretation as Harrell's C for survival data.

Value

A scalar number corresponding to the summary measure of interest.

References

Harrell, F. E., R. M. Califf, D. B. Pryor, K. L. Lee and R. A. Rosati (1982).
Evaluating the yield of medical tests.
Journal of the American Medical Association 247, 2543–2546.

Harrell, F. E., K. L. Lee, R. M. Califf, D. B. Pryor and R. A. Rosati (1984).
Regression modeling strategies for improved prognostic prediction.
Statistics in Medicine 3, 143–152.

Heagerty, P. J. and Y. Zheng (2005).
Survival model predictive accuracy and ROC curves.
Biometrics 61, 92–105.

See Also

AUC.cd, AUC.sh, AUC.uno, AUC.hc

Examples

data(cancer,package="survival")
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)

lp <- predict(train.fit)
lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)
times <- seq(10, 1000, 10)                  


AUC_CD <- AUC.cd(Surv.rsp, Surv.rsp.new, lp, lpnew, times)
IntAUC(AUC_CD$auc, AUC_CD$times, runif(length(times),0,1), median(times), auc.type="cumulative")

R2-type coefficients for Cox proportional hazards models

Description

R2-type Coefficients for Cox proportional hazards models

Usage

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

Arguments

Surv.rsp

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

lp

The vector of predictors.

lp0

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

Details

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.

Value

The estimated R2 coefficient.

References

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

Examples

data(cancer,package="survival")
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)

Plot method for survAUC and survErr Objects

Description

Plot a survAUC object generated by the functions AUC.uno, AUC.sh, AUC.cd, AUC.hc and predErr.

Usage

## S3 method for class 'survAUC'
plot(x, col="red", type="l", ylim=c(0,1),
        xlab="Time",ylab="AUC", 
        main="Time-dependent AUC", add=FALSE, ...)

## S3 method for class 'survErr'
plot(x, col="red", type="l", ylim=c(0,1),
        xlab="Time",ylab="Prediction error", 
        main="Time-dependent Prediction Error", add=FALSE, ...)

Arguments

x

An object of class survAUC.

col

The color used to draw the AUC curve.

type

The type of plot to be drawn. See argument 'type' of the plot function.

ylim

The y limits of the plot.

xlab

The title of the x axis. See title.

ylab

The title of the y axis. See title.

main

The main title of the plot. See title.

add

A logical specifying whether the AUC-Curve should be added to an already existing plot.

...

Graphics parameters that can be passed to 'plot'.

See Also

AUC.sh, AUC.cd, AUC.hc, AUC.uno, predErr

Examples

data(cancer,package="survival")
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)

lp <- predict(train.fit)
lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)
times <- seq(10, 600, 10)                  

AUC_sh <- AUC.sh(Surv.rsp, Surv.rsp.new, lp, lpnew, times)
plot(AUC_sh)
abline(h = 0.5)

BrierScore <- predErr(Surv.rsp, Surv.rsp.new, lp, lpnew, times, 
                      type = "brier", int.type = "weighted")
plot(BrierScore)
abline(h = 0.25)

Distance-based estimators of survival predictive accuracy

Description

Inverse-probability-of-censoring weighted estimators of absolute and squared deviations between survival functions

Usage

predErr(Surv.rsp, Surv.rsp.new, lp, lpnew, times, 
        type = "brier", int.type = "unweighted")

Arguments

Surv.rsp

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

Surv.rsp.new

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

lp

The vector of predictors estimated from the training data.

lpnew

The vector of predictors obtained from the test data.

times

A vector of time points at which to evaluate the prediction error curve.

type

A string specifying the type of prediction error curve: 'brier' refers to the squared deviation between predicted and observed survival (Brier score), 'robust' refers to the absolute deviation between predicted and observed survival.

int.type

A string specifying the type of integration method for the prediction error curves. Either 'unweighted' or 'weighted'.

Details

This function implements two types of prediction error curves for right-censored time-to-event data: The Brier Score (type = "brier", Gerds and Schumacher 2006) estimates the squared deviation between predicted and observed survival whereas the method proposed by Schmid et al. (2011) estimates the absolute deviation between predicted and observed survival (type = "robust").

Both methods are based on inverse-probability-of-censoring weights and do not assume a specific working model for survival prediction. Note, however, that the estimators implemented in predErr, are restricted to situations where the random censoring assumption holds.

Time-independent summary measures of prediction error are given by the the areas under the prediction error curves. If int.type = "weighted", prediction errors are weighted by the estimated probability density of the time-to-event outcome.

Value

predErr returns an object of class survErr. Specifically, predErr returns a list containing the following components:

error

The prediction error estimates (evaluated at times).

times

The vector of time points at which prediction errors are evaluated.

ierror

The integrated prediction error.

References

Gerds, T. A. and M. Schumacher (2006).
Consistent estimation of the expected Brier score in general survival models with right-censored event times.
Biometrical Journal 48, 1029–1040.

Schmid, M., T. Hielscher, T. Augustin, and O. Gefeller (2011).
A robust alter- native to the Schemper-Henderson estimator of prediction error.
Biometrics 67, 524–535.

See Also

IntAUC, OXS, schemper

Examples

data(cancer,package="survival")
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)

lp <- predict(train.fit)
lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)
times <- 1:500                  

predErr(Surv.rsp, Surv.rsp.new, lp, lpnew, times, 
        type = "brier", int.type = "unweighted")

predErr(Surv.rsp, Surv.rsp.new, lp, lpnew, times, 
        type = "robust", int.type = "unweighted")

predErr(Surv.rsp, Surv.rsp.new, lp, lpnew, times, 
        type = "brier", int.type = "weighted")

Distance-based estimator of survival predictive accuracy proposed by Schemper and Henderson

Description

Schemper and Henderson's estimator of the absolute deviation between survival functions

Usage

schemper(train.fit, traindata, newdata)

Arguments

train.fit

A cph object containing the fit of a Cox proportional hazards model.

traindata

A data frame containing the set of training data.

newdata

A data frame containing the set of test data.

Details

This code has been adapted from Lusa et al. (2007). Schemper and Henderson's estimator (as implemented by Lusa et al. 2007) assumes that predictions of the time-to-event outcome were obtained from a Cox proportional hazards model. The estimator is valid as long as the Cox model is specified correctly.

Technical details:

  • The Cox model has to be estimated via the cph function of the Design package.

  • The survival times and the censoring indicators have to be labelled “time” and “status”, respectively (see example below).

  • In contrast to the other estimators implemented in the survAUC package, schemper does not estimate the survival function of the censoring distribution from the training data but from the test data.

For details on the estimator and its implementation, we refer to Schemper and Henderson (2000) and Lusa et al. (2007).

Value

schemper returns a list with the following components:

Model

The call to cph.

D

The estimator of predictive accuracy obtained from the covariate-free null model.

Dx

The estimator of predictive accuracy obtained from the Cox model.

V

The estimator of relative gains in predictive accuracy.

Mhat

The absolute distance estimator obtained from the Cox model (evaluated at the event times of the test data).

Mhat.0

The absolute distance estimator obtained from the covariate-free null model (evaluated at the event times of the test data).

timep

The event times of the test data.

References

Schemper, M. and R. Henderson (2000).
Predictive accuracy and explained variation in Cox regression.
Biometrics 56, 249–255.

Lusa, L., R. Miceli and L. Mariani (2007).
Estimation of predictive accuracy in survival analysis using R and S-PLUS.
Computer Methods and Programms in Biomedicine 87, 132–137.

See Also

IntAUC, predErr, OXS

Examples

data(cancer,package="survival")
ovarian$time <- ovarian$futime
ovarian$status <- ovarian$fustat
set.seed(2011)
trobs <- sample(1:26,16)
TR <- ovarian[trobs,]
TE <- ovarian[-trobs,]
train.fit  <- rms::cph(survival::Surv(time, status) ~ age,
                  x=TRUE, y=TRUE, method="breslow", data=TR)

schemper(train.fit, TR, TE)

C-statistic by Uno et al.

Description

Censoring-adjusted C-statistic by Uno et al.

Usage

UnoC(Surv.rsp, Surv.rsp.new, lpnew, time = NULL)

Arguments

Surv.rsp

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

Surv.rsp.new

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

lpnew

The vector of predictors obtained from the test data.

time

A positive number restricting the upper limit of the time range under consideration.

Details

This function implements the censoring-adjusted C-statistic proposed by Uno et al. (2011). It has the same interpretation as Harrell's C for survival data (implemented in the rcorr.cens function of the Hmisc package).

Uno's estimator is based on inverse-probability-of-censoring weights and does not assume a specific working model for deriving the predictor lpnew. It is assumed, however, that there is a one-to-one relationship between the predictor and the expected survival times conditional on the predictor. Note that the estimator implemented in UnoC is restricted to situations where the random censoring assumption holds.

Value

The estimated C-statistic.

References

Harrell, F. E., R. M. Califf, D. B. Pryor, K. L. Lee and R. A. Rosati (1982).
Evaluating the yield of medical tests.
Journal of the American Medical Association 247, 2543–2546.

Harrell, F. E., K. L. Lee, R. M. Califf, D. B. Pryor and R. A. Rosati (1984).
Regression modeling strategies for improved prognostic prediction.
Statistics in Medicine 3, 143–152.

Uno, H., T. Cai T, M. J. Pencina, R. B. D'Agostino and W. L. Wei (2011).
On the C-statistics for evaluating overall adequacy of risk prediction procedures with censored survival data.
Statistics in Medicine 30, 1105–1117.

See Also

GHCI, AUC.sh, IntAUC

Examples

data(cancer,package="survival")
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)

lpnew <- predict(train.fit, newdata=TE)
Surv.rsp <- survival::Surv(TR$futime, TR$fustat)
Surv.rsp.new <- survival::Surv(TE$futime, TE$fustat)              

Cstat <- UnoC(Surv.rsp, Surv.rsp.new, lpnew)
Cstat