plotAUCcurveDiff: Plot the curve of the difference of two time-dependent AUCs...

Description Usage Arguments Details Note Author(s) References See Also Examples

View source: R/plotAUCcurveDiff.R

Description

This function plots the curve of the difference of two time-dependent AUCs over time. Pointwise and simultaneous confidence bands for this curve can also be plotted when inverse probability of censoring weights are computed from a Kaplan-Meier estimator.

Usage

1
2
plotAUCcurveDiff(object1, object2, FP = 2, add = FALSE, conf.int = FALSE,
                 conf.band = FALSE, col = "black", ylim = c(-0.5, 0.5))

Arguments

object1

An object of class "ipcwsurvivalROC" or "ipcwcompetingrisksROC" previously estimated from the timeROC function.

object2

An object of class "ipcwsurvivalROC" or "ipcwcompetingrisksROC" previously estimated from the timeROC function.

FP

In the competing risks setting, a numeric value that indicates which definition of AUC is plotted. 1 for definition (i) and 2 for definition (ii). (See details of timeROC function for definitions (i) and (ii)). Default is FP = 2.

add

A logical value that indicates if you want to add the AUC curve to a pre-existing plot. Default is add = FALSE.

conf.int

A logical value that indicates whether or not you want to plot the bands of pointwise confidence intervals. Default is conf.int = FALSE. For choosing conf.int = TRUE, the objects object1 and object2 must have been estimated by the timeROC function with arguments weighting="marginal" and iid = TRUE.

conf.band

A logical value that indicates whether or not you want to plot the simultaneous confidence bands. Default is conf.band = FALSE. For choosing conf.band = TRUE, the objects object1 and object2 must have been estimated by the timeROC function with arguments weighting="marginal" and iid = TRUE.

col

The color to plot the AUC curve. Default is col = "black".

ylim

The range of the y-axis. Default is ylim = c(-0.5,0.5).

Details

Simultaneous confidence bands can be of particular interest for testing null hypotheses such as "for all time t within an interval, AUC(t) for both markers are equal", by observing whether or not the zero line is contained within the band.

Note

The two markers evluated in objects object1 and object2 must have been measured on the same subjects.

Author(s)

Paul Blanche [email protected]

References

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.

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

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## Not run: 
## computation times is roughly 10 seconds

##-------------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.
ROC.bili<-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.02)),
                  iid=TRUE)
ROC.bili    
# we evaluate bilirubin as a prognostic biomarker for death.
ROC.albumin<-timeROC(T=pbc$time,
                     delta=pbc$status,marker=-pbc$albumin,
                     cause=1,weighting="marginal",
                     times=quantile(pbc$time,probs=seq(0.2,0.8,0.02)),
                     iid=TRUE)
ROC.albumin
# plot AUC curve for albumin and bilirunbin  with pointwise confidence interval
plotAUCcurve(ROC.albumin,conf.int=TRUE,col="red")
plotAUCcurve(ROC.bili,conf.int=TRUE,col="blue",add=TRUE)
legend("bottomright",c("albumin","bilirunbin"),col=c("red","blue"),lty=1,lwd=2)
#plot the curve of the difference of the two time-dependent AUCs over time
plotAUCcurveDiff(ROC.bili,ROC.albumin,conf.int=TRUE,conf.band=TRUE,ylim=c(-0.2,0.5))

##-------------With competing risks-------------------     
data(Melano)
head(Melano)     
# Evaluate tumor thickness as a prognostic biomarker for
# death from malignant melanoma.
ROC.thick<-timeROC(T=Melano$time,delta=Melano$status,
                   marker=Melano$thick,cause=1,
                   times=quantile(Melano$time,probs=seq(0.2,0.8,0.01)),
                   iid=TRUE)
ROC.thick
ROC.age<-timeROC(T=Melano$time,delta=Melano$status,
                   marker=Melano$age,cause=1,
                   times=quantile(Melano$time,probs=seq(0.2,0.8,0.01)),
                   iid=TRUE)
ROC.age
# plot the two AUC curves on the same plot
plotAUCcurve(ROC.thick,FP=2,conf.int=TRUE,col="blue")
plotAUCcurve(ROC.age,FP=2,conf.int=TRUE,col="red",add=TRUE)
legend("bottomright",c("thickness","age"),col=c("blue","red"),lty=1,lwd=2)
# plot the curve of the difference of the two time-dependent AUCs over time
plotAUCcurveDiff(ROC.thick,ROC.age,FP=2,conf.int=TRUE,conf.band=TRUE,col="red")

## End(Not run)

timeROC documentation built on May 29, 2017, 7:54 p.m.