R/schemper.R
schemper.RdSchemper and Henderson's estimator of the absolute deviation between survival functions
schemper(train.fit, traindata, newdata)schemper returns a list with the following components:
The call to cph.
The estimator of predictive accuracy obtained from the covariate-free null model.
The estimator of predictive accuracy obtained from the Cox model.
The estimator of relative gains in predictive accuracy.
The absolute distance estimator obtained from the Cox model (evaluated at the event times of the test data).
The absolute distance estimator obtained from the covariate-free null model (evaluated at the event times of the test data).
The event times of the test data.
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).
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.
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)
#> $Model
#> rms::cph(formula = survival::Surv(time, status) ~ age, data = TR,
#> method = "breslow", x = TRUE, y = TRUE)
#>
#> $D
#> [1] 0.3460937
#>
#> $Dx
#> [1] 0.3169285
#>
#> $V
#> [1] 0.0842697
#>
#> $Mhat
#> [1] 0.4213731 0.3293749 0.2482184 0.2994786 0.2930806
#>
#> $Mhat.0
#> [1] 0.1000 0.2375 0.4000 0.4500 0.5000
#>
#> $timep
#> [1] 59 156 365 431 464
#>