pe: Calculate prediction error curve

Description Usage Arguments Details Value Author(s) References Examples

View source: R/prederror.R

Description

Calculate prediction error curve.

Usage

1
2
3
4
pe(time, status, tsurv, survmat, tcens, censmat, FUN = c("KL", "Brier"), tout)

pecox(formula, censformula, data, censdata, FUN = c("KL", "Brier"), tout,
  CV = FALSE, progress = FALSE)

Arguments

time

Vector of time points in data

status

Vector of event indicators in data

tsurv

Vector of time points corresponding to the estimated survival probabilities in survmat

survmat

Matrix of estimated survival probabilities; dimension should be length of tsurv x length of time

tcens

Vector of time points corresponding to the estimated censoring probabilities in censmat

censmat

Matrix of estimated censoring probabilities; dimension should be length of tcens x length of time

FUN

The error function, either "KL" (default) for Kullback-Leibler or "Brier" for Brier score

tout

Vector of time points at which to evaluate prediction error. If missing, prediction error will be evaluated at all time points where the estimate will change value

formula

Formula for prediction model to be used as in coxph

censformula

Formula for censoring model, also to be used as in coxph

data

Data set in which to interpret formula

censdata

Data set in which to interpret censformula

CV

Boolean (default=FALSE); if TRUE, (leave-one-out) cross-validation is used for the survival probabilities

progress

Boolean (default=FALSE); if TRUE, progress is printed on screen

Details

The censformula is used to calculate inverse probability of censoring weights (IPCW).

Value

A data frame with columns

time

Event time points

Err

Prediction error of model specified by formula at these time points

Author(s)

Hein Putter H.Putter@lumc.nl

References

Graf E, Schmoor C, Sauerbrei W & Schumacher M (1999), Assessment and comparison of prognostic classification schemes for survival data, Statistics in Medicine 18, 2529-2545.

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

van Houwelingen HC, Putter H (2012). Dynamic Prediction in Clinical Survival Analysis. Chapman & Hall.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(ova)
# Example on a subset, because the effect of CV is clearer
ova2 <- ova[1:100,]
pecox(Surv(tyears, d) ~ Karn + Broders + FIGO + Ascites + Diam, Surv(tyears, 1-d) ~ 1,
  data = ova2, FUN="Brier", tout=seq(0,6,by=0.5))
pecox(Surv(tyears, d) ~ Karn + Broders + FIGO + Ascites + Diam, Surv(tyears, 1-d) ~ 1,
  data = ova2, FUN="Brier", tout=seq(0,6,by=0.5), CV=TRUE, progress=TRUE)


pecox(Surv(tyears, d) ~ Karn + Broders + FIGO + Ascites + Diam, Surv(tyears, 1-d) ~ 1,
  data = ova, FUN="Brier", tout=seq(0,6,by=0.5))
pecox(Surv(tyears, d) ~ Karn + Broders + FIGO + Ascites + Diam, Surv(tyears, 1-d) ~ 1,
  data = ova, FUN="Brier", tout=seq(0,6,by=0.5), CV=TRUE, progress=TRUE)

dynpred documentation built on May 2, 2019, 5:07 a.m.