SeSpPPVNPV: Time-dependent Sensitivity (Se), Specificity (Sp), Positive...

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

View source: R/SeSpPPVNPV.R

Description

This function aim at estimating time-dependent Sensitivity (Se), Specificity (Sp), Positive Predictive Value (PPV) and Negative Predictive Value (NPV) at a given cutpoint. Standard error computation via iid-representation of the estimator is also implemented.

Usage

1
2
SeSpPPVNPV(cutpoint, T, delta, marker, other_markers = NULL, cause,
           weighting = "marginal", times, iid = FALSE)

Arguments

cutpoint

The cutpoint for maker value at which we aim at estimating Se, Sp, PPV and NPV.

T

The vector of (censored) event-times.

delta

The vector of event indicators at the corresponding value of the vector T. Censored observations must be denoted by the value 0.

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 method="marginal". Default value is other_markers=NULL.

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 1). With competing risks, subjects can undergo different type of events; then, it must be the value corresponding to the event of interest, for which we aim to compute the ROC curve (usually 1 or 2).

weighting

The method used to compute the weights. weighting="marginal" uses the Kaplan-Meier estimator of the censoring distribution. weighting="cox" and weighting="aalen" model the censoring by the Cox model and the additive Aalen model respectively. Default value is weighting="marginal".

times

The vector of times points "t" at which we want to compute the time-dependent ROC curve. If vector times contains only a single value, then value zero is added.

iid

A logical value that indicates if we want to compute the iid-representation of the area under time-dependent ROC curve estimator. iid = TRUE is required for computation of all inference procedures (Confidence intervals or test for comparing AUCs). For large sample size (greater than 2000, say) and/or large length of vector times, the computation of the iid representations might be time-consuming.

Details

This function computes Inverse Probability of Censoring Weighting (IPCW) estimates of Sensitivity (Se), Specificity (Sp), Positive Predictive Value (PPV) and Negative Predictive Value (NPV) for Cumulative/Dynamic definition of 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 <=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 δ_i in the following. Let suppose that we are interested in the event δ_i=1. Then, a case is defined as a subject i with T_i <=t and δ_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 <=t and δ_i != 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 "ipcwsurvivalSeSpPPVNPV" or "ipcwcompetingrisksSeSpPPVNPV", 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 "ipcwsurvivalSeSpPPVNPV" :

Specific objects of class "ipcwcompetingrisksSeSpPPVNPV" :

Objects common to both classes :

Author(s)

Paul Blanche pabl@sund.ku.dk

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.

See Also

timeROC

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
##-------------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     
# Se, Sp, PPV and NPV computation for serum bilirunbin at threshold c=0.9(mg/dl) 
res.SeSpPPVNPV.bili <- SeSpPPVNPV(cutpoint=0.9,
                                  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)
res.SeSpPPVNPV.bili

##-------------With competing risks-------------------

#---------Example with Paquid data--------
data(Paquid)
# Se, Sp, PPV and NPV computation for DSST at threshold c=22
res.SeSpPPVNPV.DSST <- SeSpPPVNPV(cutpoint=22,
                                  T=Paquid$time,
                                  delta=Paquid$status,marker=Paquid$DSST,
                                  cause=1,weighting="cox",
                                  times=c(3,5,8,10))
res.SeSpPPVNPV.DSST

#---------Example with Melano data-------
data(Melano)
# Se, Sp, PPV and NPV computation for tumor thickness at threshold c=3 (1/100 mm)
res.SeSpPPVNPV.thick <- SeSpPPVNPV(cutpoint=3,
                                  T=Melano$time,delta=Melano$status,
                                  weighting="marginal",
                                  marker=Melano$thick,cause=1,
                                  times=c(1800,2000,2200),
                                  iid=TRUE)
res.SeSpPPVNPV.thick

Example output

  id time status trt      age sex ascites hepato spiders edema bili chol
1  1  400      2   1 58.76523   f       1      1       1   1.0 14.5  261
2  2 4500      0   1 56.44627   f       0      1       1   0.0  1.1  302
3  3 1012      2   1 70.07255   m       0      0       0   0.5  1.4  176
4  4 1925      2   1 54.74059   f       0      1       1   0.5  1.8  244
5  5 1504      1   2 38.10541   f       0      1       1   0.0  3.4  279
6  6 2503      2   2 66.25873   f       0      1       0   0.0  0.8  248
  albumin copper alk.phos    ast trig platelet protime stage
1    2.60    156   1718.0 137.95  172      190    12.2     4
2    4.14     54   7394.8 113.52   88      221    10.6     3
3    3.48    210    516.0  96.10   55      151    12.0     4
4    2.54     64   6121.8  60.63   92      183    10.3     4
5    3.53    143    671.0 113.15   72      136    10.9     3
6    3.98     50    944.0  93.00   63       NA    11.0     3
Predictive accuracy measures at cutpoint c=0.9 estimated using IPCW (n=312, with competing risks). 
No. of positive (X>c) =208, No. of negative (X<=c) =104. 

         Cases Survivors Censored Se (%) se_Se Sp (%) se_Sp PPV (%) se_PPV
t=999.2     53       249       10  94.38  3.16  40.16  3.11   24.59   3.03
t=1307.4    68       218       26  94.12  2.86  43.12  3.36   32.10   3.34
t=1839.5    86       156       70  92.63  2.92  50.64  4.01   43.84   3.84
t=2555.7   102        94      116  85.60  3.89  50.00  5.17   51.35   4.28
t=3039     108        63      141  85.49  3.79  52.38  6.30   57.23   4.79
         NPV (%) se_NPV
t=999.2    97.19   1.61
t=1307.4   96.25   1.84
t=1839.5   94.29   2.30
t=2555.7   84.92   4.21
t=3039     82.89   4.65

Method used for estimating IPCW:marginal 

Total computation time : 0.15  secs.
Predictive accuracy measures at cutpoint c=22 estimated using IPCW (n=2561, with competing risks). 
No. of positive (X>c) =1634, 
No. of negative (X<=c) =927. 
     Cases Survivors Other events Censored    Se  Sp_1  Sp_2 PPV (%) NPV_1
t=3     70      2117          194      180 20.04 32.00 33.89    0.89 81.07
t=5    122      1834          313      292 22.95 29.11 32.29    1.82 68.73
t=8    225      1388          454      494 32.38 25.69 30.77    5.04 52.02
t=10   318      1107          545      591 36.53 22.70 29.56    8.38 39.59
     NPV_2
t=3  93.44
t=5  88.47
t=8  80.03
t=10 72.52

Method used for estimating IPCW:cox 

Total computation time : 2.79  secs.
Predictive accuracy measures at cutpoint c=3 estimated using IPCW (n=205, with competing risks). 
No. of positive (X>c) =72, 
No. of negative (X<=c) =133. 
       Cases Survivors Other events Censored    Se se_Se  Sp_1 se_Sp1  Sp_2
t=1800    45       124            9       27 66.17  7.10 70.97   4.09 70.10
t=2000    46       103           10       46 64.28  7.14 71.84   4.44 70.33
t=2200    50        83           11       61 59.61  7.11 71.08   4.99 69.86
       se_Sp_2 PPV (%) se_PPV NPV_1 se_NPV_1 NPV_2 se_NPV_2
t=1800    3.98   38.92   5.71 83.83     3.34 87.80     2.97
t=2000    4.31   39.31   5.90 82.87     3.46 86.82     3.11
t=2200    4.76   41.11   6.17 77.86     4.07 83.05     3.67

Method used for estimating IPCW:marginal 

Total computation time : 2.16  secs.

timeROC documentation built on Dec. 25, 2019, 9:06 a.m.

Related to SeSpPPVNPV in timeROC...