khazard: Kernel estimate of hazard function for right-censored data

Description Usage Arguments Details Value References See Also Examples

Description

Kernel estimate of (unconditional) hazard function for right-censored data. Options include two methods for bandwidth selection.

Usage

1
2
3
4
5
khazard(times, delta, h = NULL, t = NULL, t.length = 100,
  tmin = NULL, tmax = NULL, kernel = "epanechnikov",
  type = "interior", parallel = FALSE, value = "CVML",
  h.method = "crossval", optim.method = "optimize",
  tol = ifelse(h.method == "crossval", 10^(-6), 1), run = 2, ...)

Arguments

times

vector of observed times

delta

vector of censoring indicator. 0 - censored, 1 - uncensored (dead)

h

bandwidth (scalar or vector). If missing, h is found using some bandwidth selection method.

t

vector of time points at which estimate is evaluated

t.length

number of grid points

tmin, tmax

minimum/maximum values for grid

kernel

kernel function, possible values are: "epanechnikov" (default), "gaussian", "rectangular", "quartic".

type

Type of kernel estimate. Possible types are: "exterior", "interior" (default).

parallel

allows parallel computation. Default is FALSE.

value

If h parameter is vector, this option controls output values. If "CVML" (default), the crossvalidation or log-likelihood values only are calculated. If "hazard", the hazard functions only are calculated. If "both" the crossvalidation or log-likelihood values and hazard function are calculated.

h.method

method for bandwidth selection. Possible methods are: "crossval" (default), "maxlike".

optim.method

method for numerical optimization of the crossvalidation or log-likelihood function. Possible methods are: "optimize" (default), "ga".

tol

the desired accuracy of optimization algorithm

run

the number of consecutive generations without any improvement in the best fitness value before the GA is stopped.

...

additional arguments of GA algorithm

Details

External type of kernel estimator is defined as the ratio of kernel estimator of the subdensity of the uncensored observations to the survival function of the observable time. Internal type of kernel estimator is based on a convolution of the kernel function with a nonparametric estimator of the cumulative hazard function (Nelson-Aalen estimator).

Value

Returns an object of class 'khazard' which is a list with fields

time.points

vector of time points at which estimate is evaluated

hazard

data frame of time points, hazard function values and bandwidth

h

bandwidth

CVML

value of crossvalidation or log-likelihood at h

details

description of used methods

GA.result

output of ga, object of class ga-class

References

Selingerova, I., Dolezelova, H., Horova, I., Katina, S., and Zelinka, J. (2016). Survival of Patients with Primary Brain Tumors: Comparison of Two Statistical Approaches. PloS one, 11(2), e0148733.

See Also

plot.khazard, ga, optimize

Examples

1
2
library(survival)
fit<-khazard(times = lung$time,delta = lung$status-1)

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 

kernhaz documentation built on May 1, 2019, 9:19 p.m.