Description Usage Arguments Details Value References Examples
Provides smooth estimations of Cumulative/Dynamic (C/D) and Incident/Dynamic (I/D) ROC curves in presence of rigth censorship and the corresponding Areas Under the Curves (AUCs), at a single point of time or a vector of points.
The function computes two different procedures to obtain smooth estimations of the C/D ROC curve. Both are based on the kernel density estimation of the joint distribution function of the marker and timetoevent variables, provided by funcen
function. The first method, to which we will refere as smooth method, is carried out according to the methodology proposed in https://doi.org/10.1177/0962280217740786. The second one uses this estimation of the joint density function of the variables marker and timetoevent for computing the weights or probabilities allocated to censored observations (undefined individuals) in https://doi.org/10.1080/00949655.2016.1175442 and https://doi.org/10.1177/0962280216680239. It will be referred as pkernel method.
In case of the I/D ROC curve, a smooth approximation procedure (smooth method) is computed based as well on the kernel density estimation of the joint distribution function of the marker and timetoevent variables proposed in https://doi.org/10.1177/0962280217740786
1 
data 
matrix of data values with three columns: timetoevent, censoring status (0=censored/1=uncensored) and marker. 
t 
point of time or vector of points where the timedependent ROC curve is estimated. 
H 
2x2 bandwidth matrix. 
bw 
procedure for computing the bandwidth matrix. Most of the methods included at the 
adj 
adjusment parameter for calculating the bandwidth matrix. Default value 1. 
tcr 
type of timedependent ROC curve estimation that will be estimated:

meth 
method for computing the estimation of the C/D ROC curve.The suitable values are:
As default value the smooth method is taken. 
... 

Function funcen
is called from each execution of function stRoc
, in order to compute the kernel
density estimation of the joint distribution of the (Marker, Timetoevent) variable, therefore, the input
parameters in funcen
are input parameters as well in stRoc
and the same considerations apply.
The matrix of bandwidths can be defined by using H=matrix() or automatically selected by the method indicated in bw
.
Given the matrix of bandwidths, H, the argument adj
modifies it and the final matrix is adj^2 H.
If H
is missing, the naive.pdf method is used.
If tcr
is missing the C/D ROC curve estimation will be computed with the method indicated in meth
.
If no value has been placed in meth
the smooth method will be used. The I/D ROC curve estimation will be always computed with the smooth method.
An object of class sROCt
is returned. It is a list with the following values:
th 
considered thresholds for the marker. 
FP 
falsepositive rate calculated at each point in 
TP 
truepositive rate estimated at each point in 
p 
points where the timedependent ROC curve is evaluated. 
R 
timedependent ROC curve values computed at 
t 
time/s at which each timedependent ROC curve estimation is computed. Each point ot time will appear as many times as the length of the vector of points 
auc 
area under the corresponding timedependent ROC curve estimation. As in the previous case, each value appears as many times as the length of the vector of points 
tcr 
type of timedependent ROC curve estimation computed,
For each computed timedependent ROC curve estimation this value is repeated as many times as the length of 
Pi 
probabilities calculated for the individuals in the sample if the pkernel method has been used for the estimation of the C/D ROC curve. This element is a matrix with the following columns:

P. MartinezCamblor and J. C. PardoFernandez. Smooth timedependent receiver operating characteristic curve estimators. Statistical Methods in Medical Research, 27(3):651674, 2018.https://doi.org/10.1177/0962280217740786.
P. MartinezCamblor, G. FBay?n, and S. P?rezFern?ndez. Cumulative/dynamic ROC curve estimation. JOURNAL of Statistical Computation and Simulation, 86(17):35823594, 2016. https://doi.org/10.1080/00949655.2016.1175442.
L. Li, T. Green, and B. Hu. A simple method to estimate the timedependent receiver operating characteristic curve and the area under the curve with right censored data. Statistical Methods in Medical Research, 27(8), 2016. https://doi.org/10.1177/0962280216680239.
T. Duong. Bandwidth matrices for multivariate kernel density estimation. Ph.D. Thesis, University of Western, Australia, 2004. http://www.mvstat.net/tduong.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  library(smoothROCtime)
require(KMsurv)
data(kidtran)
# Preparing data: a logarithmic transformation of the timetoevent variable is made
DT < cbind(log(kidtran$time),kidtran$delta,kidtran$age)
# Point of Time
t5 < log(5*365.25) # five years in logarithm scale
# Cumulative/dynamic ROC curve estimation
rcd < stRoc(data=DT, t=t5, bw="Hpi", tcr="C", meth=2)
# Plot graphic
plot(rcd$p, rcd$ROC, type="l", lwd=5, main="C/D ROC",xlab="FPR",ylab="TPR")
lines(c(0,1),c(0,1),lty=2,col="gray")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.