discretise.data {DOvalidation}R Documentation

Aggregate data in the form of occurrences and exposures

Description

Aggregate data in the form of occurrences and exposures from individual survival data (possibly right censored and/or left truncated).

Usage

  discretise.data(Li, Zi, deltai, xi, M)

Arguments

Li

Vector of truncation levels: the datum is registered only if the life time is greater than the truncation level.

Zi

Vector of observed life times (Zi=min(Ti,Ci) with Ci censoring value and Ti the true life time).

deltai

Vector with non-censoring indicator values (0 if datum is censored, 1 otherwise).

xi

Optional. Vector with the grid of time points where the occurrences and exposures should be calculated. If not provide the grid is calculated automatically.

M

Optional. A positive scalar used as the grid size. If not provided it is chosen automatically.

Details

The hazard estimators and bandwidth selectors available in the DOvalidation package work from data aggregated in the form of occurrences and exposures. This function can be used to work with individual survival data in the form (Li,Zi,deltai) – left-truncation level (Li), observed time (Zi) and non-censoring indicator (deltai). If data are not truncated then Li can be chosen as 0.

Value

xi

Vector with the time grid points.

Oi

Vector with the calculated occurrences at the time grid points.

Ei

Vector with the calculated exposures at the time grid points.

Author(s)

Gamiz, M.L., Mammen, E., Martinez-Miranda, M.D. and Nielsen, J.P.

References

Gamiz, M.L., Mammen, E., Martinez-Miranda, M.D. and Nielsen, J.P.(2016). Double one-sided cross-validation of local linear hazards. Journal of the Royal Statistical Society B, 78, 755-779.

See Also

hazard.LL

Examples

## A simple example with right censored data
Zi<-c(3,6,7,7,8,10,11,11,11,12,13,13,14,16,20,20,22,32,34,36)
n<-length(Zi)
Li<-deltai<-rep(0,n) 
ind.cens<-c(1,3,4,8,9,13,14,15,16)
deltai[-ind.cens]<-1
## Obtain the occurrences and exposures for a grid of 6 time points
res<-discretise.data(Li,Zi,deltai,M=6)
## Now calculate the local linear hazard estimator
hazard.LL(res$xi,res$Oi,res$Ei,res$xi,b=10)

[Package DOvalidation version 1.1.0 Index]