View source: R/surv_measures.R
predErr | R Documentation |
Inverse-probability-of-censoring weighted estimators of absolute and squared deviations between survival functions
predErr(Surv.rsp, Surv.rsp.new, lp, lpnew, times,
type = "brier", int.type = "unweighted")
Surv.rsp |
A |
Surv.rsp.new |
A |
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'. |
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.
predErr
returns an object of class survErr
. Specifically,
predErr
returns a list containing the following components:
error |
The prediction error estimates (evaluated at |
times |
The vector of time points at which prediction errors are evaluated. |
ierror |
The integrated prediction error. |
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.
IntAUC
, OXS
, schemper
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.