tdrocc {survcomp} | R Documentation |
The function is a wrapper for the survivalROC
function in order to compute the time-dependent ROC curves.
tdrocc(x, surv.time, surv.event, surv.entry = NULL, time, cutpts = NA, na.rm = FALSE, verbose = FALSE, span = 0, lambda = 0, ...)
x |
vector of risk scores |
surv.time |
vector of times to event occurrence |
surv.event |
vector of event occurrence indicators |
surv.entry |
entry time for the subjects |
time |
time point for the ROC curve |
cutpts |
cut points for the risk score |
na.rm |
TRUE if the missing values should be removed from the data, FALSE otherwise |
verbose |
verbosity of the function |
span |
Span for the NNE, need either lambda or span for NNE |
lambda |
smoothing parameter for NNE |
... |
additional arguments to be passed to the survivalROC function |
spec |
specificity estimates |
sens |
sensitivity estimates |
rule |
rule to compute the predictions at each cutoff |
cuts |
cutoffs |
time |
time point at which the time-dependent ROC is computed |
survival |
overall survival at the time point |
AUC |
Area Under the Curve (AUC) of teh time-dependent ROC curve |
data |
survival data and risk score used to compute the time-dependent ROC curve |
Benjamin Haibe-Kains
Heagerty, P. J. and Lumley, T. L. and Pepe, M. S. (2000) "Time-Dependent ROC Curves for Censored Survival Data and a Diagnostic Marker", Biometrics, 56, pages 337–344.
set.seed(12345) age <- rnorm(100, 50, 10) stime <- rexp(100) cens <- runif(100,.5,2) sevent <- as.numeric(stime <= cens) stime <- pmin(stime, cens) tdroc <- tdrocc(x=age, surv.time=stime, surv.event=sevent, time=1, na.rm=TRUE, verbose=FALSE) ##plot the time-dependent ROC curve plot(1-tdroc$spec, tdroc$sens, type="l", xlab="1 - specificity", ylab="sensitivity") lines(x=c(0,1), y=c(0,1), lty=3, col="red")