Description Usage Arguments Details Value References Examples
Computes the kernel density estimation of the bivariate vector (marker, timetoevent) with the timetoevent variable subject to right censorship, according to the procedure exposed in https://doi.org/10.1177/0962280217740786.
1 
data 
matrix with three columns: timetoevent, censoring status (0=censored/1=uncensored) and marker. 
H 
2x2 bandwidth matrix when it is specified in an explicit way. 
bw 
method for computing the bandwidth matrix. Most of the methods included in the 
adj 
adjusment parameter for calculating the bandwidth matrix. Default value 1. 
... 

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 computed matrix is adj^2 H.
If H is missing, the naive.pdf method is used for obtaining the kernel density estimation.
Function funcen
generates, from the original set of data, a collection of pseudodata through an iterative weights allocation process, with two main goals: keep the information from the censored observations represented in the sample and prepare data so they can be used as incoming parameters in the kde
function included in the ks package. A weighted kernel density estimation is therefore finally computed.
There should be at least two uncensored observations for computing the density estimation.
Omitted parameters are considered to be the default ones in the kde
function.
An object of class kde
is returned. It is a list where the most relevant values are:
x 
matrix containing the pseudodata values. It has two columns: marker and timetoevent. 
eval.points 
list of points where the bivariate kernel estimation is calculated. 
estimate 
values of the density estimation. 
H 
bandwidth matrix. 
names 
variable names. 
w 
weights calculated by the function and allocated to pseudodata. 
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.
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 18 19 20 21 22 23  library(smoothROCtime)
require(KMsurv)
require(lattice)
data(kidtran)
# Preparing data: a logarithmic transformationof the timetoevent variable is made
DT < cbind(log(kidtran$time),kidtran$delta,kidtran$age)
n <length(log(kidtran$time))
# Directly definition of the bandwidth matrix
H < diag((c(sd(kidtran$age),sd(log(kidtran$time)))*n^(0.2))^2)
# Kernel density function estimation
density < funcen(data=DT,H=H)
# Plot graphics
wireframe(density$estimate, row.values=density$eval.points[[1]],
column.values=density$eval.points[[1]],zlab="density")
contour(x=density$eval.points[[1]],
y=density$eval.points[[2]],
z=density$estimate,
ylim=c(6,10))

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