This package aims to help to evaluate the prognostic accuracy of a marker with multiple competing risk events. Functions to calculate the AUC, ROC, PPV, and NPV are provided. A discrete covariate Z, if available, can be included.
There are five main functions in this package:
comprisk.ROC
: Calculate the values needed to plot the ROC curve, along with the AUC.
comprisk.ROC.CI
: Calculate bootstrap confidence intervals for a given set of TPR or FPR values.
comprisk.AUC.CI
: Calculate bootstrap confidence intervals for the AUC.
comprisk.PPV
: Calculate PPV and NPV values.
comprisk.PPV.CI
: Calculate bootstrap confidence intervals for a given set of PPV, NPV, or v (marker quantile).
library(survCompetingRisk) #simulated data for illustration data(crdata) #take a look head(crdata)
##ROC curve #Set type = 1 if case is defined by the event of interest, and controls are all the rest. Set type = 2 if case is defined by stratifying on event type, and controls are those who have not experienced any events. myROC.type1 <- comprisk.ROC( times = crdata$times, status1 = crdata$status1, status2 = crdata$status2, x = crdata$x, Z = crdata$Z, predict.time = 10, type = 1) myROC.type1 #plot tmp <- myROC.type1$ROC plot(tmp$FPR[tmp$Z==0], tmp$TPR[tmp$Z==0], type="l",lwd=2, main="Type 1", xlab="FPR", ylab="TPR") lines(tmp$FPR[tmp$Z==1], tmp$TPR[tmp$Z==1], lty=2, lwd=2) legend(x="bottomright", c("Z = 0", "Z = 1"), lty=c(1,2)) lines(c(0, 1), c(0,1), col="lightgrey") ## type 2 myROC.type2 <- comprisk.ROC( times = crdata$times, status1 = crdata$status1, status2 = crdata$status2, x = crdata$x, Z = crdata$Z, predict.time = 10, type = 2) myROC.type2 comprisk.AUC.CI( times = crdata$times, status1 = crdata$status1, status2 = crdata$status2, x = crdata$x, Z = crdata$Z, predict.time = 10, type = 1, bootstraps = 25) #set to 500-1000 in practice!
Zheng Y, Cai T, Jin Y, Feng Z. Evaluating prognostic accuracy of biomarkers under competing risk. Biometrics. 2012 Jun;68(2):388-96.
Zheng Y, Cai T, Feng Z, and Stanford J. Semiparametric Models of Time-dependent Predictive Values of Prognostic Biomarkers. Biometrics. 2010, 66: 50-60.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.