AUC.cr: Calculate Time-dependent ROC and AUC with competing risk

View source: R/AUC.cr.R

AUC.crR Documentation

Calculate Time-dependent ROC and AUC with competing risk

Description

This function calculates the time-dependent sensitivity and specificity and area under the curve (AUC) using precalculated weights by td.kw.cr.

Usage

AUC.cr(X, W.prim, W.cmp, cut.off = NULL, n.grid = 1000, method)

Arguments

X

a numeric vector of risk score ranging from 0 to 1 in the same length as Y and delta. A higher value indicates higher higher risk of the event. It can be a biomarker value, a function of multiple value, or the predicted cumulative incidence probability from a copeting risk regression model that we want to evaluate.

W.prim

a numeric vector of weight for the primary event you want to study. It has the same length as X. It should be generated by td.kw.cr with event.code = 1.

W.cmp

a numeric vector of weight for the competing event. It has the same length as X. It should be generated by td.kw.cr with event.code = 2.

cut.off

a vector of risk score cut-off values at which sensitivity and specificity will be calculated. Default is NULL, and we set cut off point by n.grid to calculate sensitivity and specificity.

n.grid

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

method

Details

This function read in the risk score value X, estimated conditional probability for primary event W.prim, and estimated conditional probability for competing event W.cmp to calculate sensitivity and specificity for a series specified grid points. Based on the definition of controls mentioned in Wu and Li, 2018, we separately calculate specificity and corresponding AUC for each definition. In addition, this function returns both the AUC estimated by trapezoidal integration and AUC estimated by nonparametric framework mentioned in Wu and Li, 2018.

Value

Returns a list of the following items:

a list of AUC.A.integral estimated by trapezoidal integration for definition A, AUC.A.empirical estimated by nonparametric framework for definition A (Wu and Li, 2018), AUC.B.integral estimated by trapezoidal integration for definition B, AUC.B.empirical estimated by nonparametric framework for definition B (Wu and Li, 2018), and a data frame ROC with dimension (2+n.grid) x 4 with columns cut.off, sens, specA and specB.

See Also

survfit


tdROC documentation built on May 29, 2024, 3:47 a.m.

Related to AUC.cr in tdROC...