tdROC: Calculate Time-dependent ROC and AUC

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

View source: R/tdROC.R

Description

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.

Usage

1
2
3
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)

Arguments

X

a numeric vector of biomarker values. Same length with Y and delta.

Y

a numeric vector of time to event.Same length with X and delta.

delta

a vector of binary indicator of event (1) or censoring (0). Same length with X and Y.

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 NULL. If not specified, the function will use the value of span to calculate kernel weights. In case both span and h are specified, the function will use h.

type

a character value, indicating the type of kernel function used to calculate kernel weights. Default is "uniform" kernel. Other options are "Epanechnikov" and "normal". It will only be used when the bandwidth h is specified.

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 nboot = 0, corresponding to no variance estimation.

alpha

1-level of confidence interval, default is 0.05. It is used only when nboot > 0.

n.grid

an positive integer, the number of grid points used when calculating the ROC curve. The default is 1000.

X.min

the lower boundary of grid cut-off points for biomarker X. If not specified, default will be the minimum of biomarker X.

X.max

the upper boundary of grid cut-off points for biomarker X. If not specified, default will be the maximum of biomarker X. X.min and X.max are not needed for point estimate but are needed for bootstrap variance estimation.

Details

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).

Value

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.

Author(s)

Liang Li, Cai Wu

References

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/

See Also

survfit, mayo

Examples

1
2
3
4
5
6
7
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 ) ;

tdROC documentation built on May 2, 2019, 8:31 a.m.

Related to tdROC in tdROC...