tdROC {tdROC} | R Documentation |
This is the main function of this package. It calculates the time-dependent sensitivity and specificity and area under the curve (AUC) using a nonparametric weighting adjustment. It also provides variance estimation through bootstrap.
tdROC(X, Y, delta, tau, span = 0.1, h = NULL, type = "uniform",
cut.off = NULL, nboot = 0, alpha = 0.05, n.grid = 1000,
X.min = NULL, X.max = NULL)
X |
a numeric vector of biomarker values. Same length with |
Y |
a numeric vector of time to event.Same length with |
delta |
a vector of binary indicator of event (1) or censoring (0). Same length with |
tau |
a scalar, the prediction horizon at which the prediction is evaluated. |
span |
a numeric value, the proportion of neighbour observations used in nearest neighbor method, default is 0.1. |
h |
a numeric value, the bandwidth of kernel weights, defualt is |
type |
a character value, indicating the type of kernel function used to calculate kernel weights. Default is " |
cut.off |
a vector of biomarker cut-off values at which sensitivity and specificity will be calculated.When bootstrap is requested, the corresponding confidence intervals will also be provided. |
nboot |
the number of bootstrap replications to be used for variance estimation; default is |
alpha |
|
n.grid |
an positive integer, the number of grid points used when calculating the ROC curve. The default is |
X.min |
the lower boundary of grid cut-off points for biomarker |
X.max |
the upper boundary of grid cut-off points for biomarker |
This function read in the prognostic biomarker value X
, the time-to-event data Y
and censoring indicator delta
to calculate
the sensitivity and specificity at the prediction horizon tau
for a series specified grid points. It uses a simple
nonparametric weight adjustments for right censored data (Li et al., 2015).
Returns a list of the following items:
ROC:
a data frame of dimension (2+n.grid) x 3
, the three columns are: grid
, sens
, and spec
.
AUC:
a data frame of one row and four columns: AUC
, standard error of AUC
, the lower and upper limits of bootstrap CI.
AUC
is calculated by integrating the area under ROC curve with trapezoidal method.
AUC2:
a data frame of one row and four columns: AUC2
, standard error of AUC2
, the lower and upper limits of bootstrap CI.
AUC2
is the AUC calculated by the concordance based formula (Li et al., 2015).
prob:
a data frame of three columns if nboot=0
: cut.off
, sens
, and spec
. If nboot>0
, another six
columns of standard error, lower and upper limits of both sens
and spec
will be added. The number of rows equals length of cut.off
.
A series of sensivitity and specificity are calculated at requested cut.off
points.
Liang Li, Cai Wu
Li, Liang, Bo Hu, and Tom Greene. "A Simple Method to Estimate the Time-dependent ROC Curve Under Right Censoring." (2015). http://biostats.bepress.com/cobra/art114/
library( survival ) ;
data( mayo ) ;
dat <- mayo[ ,c( "time","censor","mayoscore5" )] ;
fm <- tdROC( X = dat$mayoscore5, Y = dat$time, delta = dat$censor,
tau = 365*6, span = 0.1, nboot = 0, alpha = 0.05,
n.grid = 1000, cut.off = 5:9 ) ;