timeROC {timeROC} | R Documentation |
Time-dependent ROC curve estimation
Description
Inverse Probability of Censoring Weighting (IPCW) estimation of Cumulative/Dynamic time-dependent ROC curve. The function works in the usual survival setting as well as in the competing risks setting. Computation of the iid-representation of areas under time-dependent ROC curves is implemented. This enables computation of inference procedures: Confidence intervals and tests for comparing two AUCs of two different markers measured on the same subjects.
Usage
timeROC(T, delta, marker, other_markers = NULL, cause,
weighting = "marginal", times, ROC = TRUE, iid = FALSE)
Arguments
T |
The vector of (censored) event-times. |
delta |
The vector of event indicators at the corresponding value of the vector |
marker |
The vector of the marker values for which we want to compute the time-dependent ROC curves. Without loss of generality, the function assumes that larger values of the marker are associated with higher risks of events. If lower values of the marker are associated with higher risks of events, then reverse the association adding a minus to the marker values. |
other_markers |
A matrix that contains values of other markers that we want to take into account for computing the inverse probability of censoring weights. The different columns represent the different markers. This argument is optional, and ignored if |
cause |
The value of the event indicator that represents the event of interest for which we aim to compute the time-dependent ROC curve. Without competing risks, it must be the value that indicates a non-censored obsevation (usually |
weighting |
The method used to compute the weights. |
times |
The vector of times points "t" at which we want to compute the time-dependent ROC curve. If vector |
ROC |
A logical value that indicates if we want to save the estimates of
sensitivities and specificties. Default value is |
iid |
A logical value that indicates if we want to compute the iid-representation of the area under time-dependent ROC curve estimator. |
Details
This function computes Inverse Probability of Censoring Weighting (IPCW) estimates of Cumulative/Dynamic time-dependent ROC curve.
By definition, time-dependent ROC curve intrinsically depends on the definitions of time-dependent cases and controls.
Let T_i
denote the event time of the subject i
.
Without competing risks : A case is defined as a subject i
with T_i \leq t
. A control is defined as a subject i
with T_i > t
.
With competing risks : In this setting, subjects may undergo different type of events, denoted by \delta_i
in the following. Let suppose that we are interested in the event \delta_i=1
. Then, a case is defined as a subject i
with T_i \leq t
and \delta_i=1
.
With competing risks, two definitions of controls were suggested: (i) a control is defined as a subject i
that is free of any event, i.e with T_i > t
, and (ii) a control is defined as a subject i
that is not a case, i.e with T_i > t
or with T_i \leq t
and \delta_i \neq 1
.
For all outputs of this package, objects named with _1
refer to definition (i). For instance AUC_1
or se_1
refer to time-dependent area under the ROC curve and its estimated standard error according to the definition (i). Objects named with _2
refer to definition (ii) .
Value
Object of class "ipcwsurvivalROC" or "ipcwcompetingrisksROC", depending on if there is competing risk or not, that is a list. For these classes, there are print, plot and confint methods. Most objects that they contain are similar, but some are specific to each class.
Specific objects of class "ipcwsurvivalROC" :
-
AUC
: vector of time-dependent AUC estimates at each time points. -
TP
: matrix of time-dependent True Positive fraction (sensitivity) estimates. -
FP
: matrix of time-dependent False Positive fraction (1-specificity) estimates.
Specific objects of class "ipcwcompetingrisksROC" :
-
AUC_1
: vector of time-dependent AUC estimates at each time points with definition (i) of controls (see Details). -
AUC_2
: vector of time-dependent AUC estimates at each time points with definition (ii) of controls (see Details). -
TP
: matrix of time-dependent True Positive fraction (sensitivity) estimates. -
FP_1
: matrix of time-dependent False Positive fraction (1-specificity) estimates with definition (i) of controls (see Details). -
FP_2
: matrix of time-dependent False Positive fraction (1-specificity) estimates with definition (ii) of controls (see Details).
Objects common to both classes :
-
times
: the time points for which the time-dependent ROC curves were computed. -
weights
: a object of class "IPCW", containing all informations about the weights. Seeipcw
function ofpec
package. -
computation_time
: the total computation time. -
CumulativeIncidence
: the vector of estimated probabilities of being a case at each time points. -
survProb
: the vector of estimated probabilities of being event-free at each time points. -
Stats
: a matrix containing descriptive statistics at each time points (like numbers of observed cases or censored observations before each time points). -
iid
: the logical value of parameteriid
used in argument. -
n
: the sample size, after having omitted missing vaues. -
inference
: a list that contains, among other things, iid-representations and estimated standard errors of the estimators, and that is used for computation of comparison tests and confidence intervals. -
computation_time
: the computation time, in seconds.
Author(s)
Paul Blanche pabl@sund.ku.dk
References
Hung, H. and Chiang, C. (2010). Estimation methods for time-dependent AUC with survival data. Canadian Journal of Statistics, 38(1):8-26
Uno, H., Cai, T., Tian, L. and Wei, L. (2007). Evaluating prediction rules for t-years survivors with censored regression models. Journal of the American Statistical Association, 102(478):527-537.
Blanche, P., Dartigues, J. F., & Jacqmin-Gadda, H. (2013). Estimating and comparing time-dependent areas under receiver operating characteristic curves for censored event times with competing risks. Statistics in medicine, 32(30), 5381-5397.
P. Blanche, A. Latouche, V. Viallon (2013). Time-dependent AUC with right-censored data: A Survey. Risk Assessment and Evaluation of Predictions, 239-251, Springer, http://arxiv.org/abs/1210.6805.
See Also
-
compare
for testing a difference of time-dependent AUCs. -
confint
for confidence intervals of time-dependent AUC. -
SeSpPPVNPV
for estimating Sensitivity (Se), Specificity (Sp), Positive Predictive Value (PPV) and Negative Predictive Value (NPV) at a given cutpoint marker value. -
plot
for plotting time-dependent ROC curves. -
plotAUCcurve
for plotting time-dependent AUC curve. -
plotAUCcurveDiff
for plotting the curve of the difference of two time-dependent AUCs over time.
Examples
##-------------Without competing risks-------------------
library(survival)
data(pbc)
head(pbc)
pbc<-pbc[!is.na(pbc$trt),] # select only randomised subjects
pbc$status<-as.numeric(pbc$status==2) # create event indicator: 1 for death, 0 for censored
# we evaluate bilirubin as a prognostic biomarker for death.
# 1) with the Kaplan-Meier estimator for computing the weights (default).
ROC.bili.marginal<-timeROC(T=pbc$time,
delta=pbc$status,marker=pbc$bili,
cause=1,weighting="marginal",
times=quantile(pbc$time,probs=seq(0.2,0.8,0.1)),
iid=TRUE)
ROC.bili.marginal
# 2) with a Cox model (with covariates bili, chol and albumin) for computing the weights.
ROC.bili.cox<-timeROC(T=pbc$time,
delta=pbc$status,marker=pbc$bili,
other_markers=as.matrix(pbc[,c("chol","albumin")]),
cause=1,weighting="cox",
times=quantile(pbc$time,probs=seq(0.2,0.8,0.1)))
ROC.bili.cox
##-------------With competing risks-------------------
#---------Example with Melano data-------
data(Melano)
# Evaluate tumor thickness as a prognostic biomarker for
# death from malignant melanoma.
ROC.thick<-timeROC(T=Melano$time,delta=Melano$status,
weighting="aalen",
marker=Melano$thick,cause=1,
times=c(1800,2000,2200))
ROC.thick
#---------Example with Paquid data--------
data(Paquid)
# evaluate DDST cognitive score as a prognostic tool for
# dementia onset, accounting for death without dementia competing risk.
ROC.DSST<-timeROC(T=Paquid$time,delta=Paquid$status,
marker=-Paquid$DSST,cause=1,
weighting="cox",
other_markers=as.matrix(Paquid$MMSE),
times=c(3,5,10),ROC=TRUE)
ROC.DSST
plot(ROC.DSST,time=5)