Description Usage Arguments Details Value References See Also Examples
Kernel estimate of conditional hazard function for right-censored data with one covariate. Options include two methods for bandwidth selection.
1 2 3 4 5 6 | khazardcond(times, delta, covariate, h = NULL, t = NULL, x = NULL,
tx = NULL, t.length = 100, x.length = 100, tmin = NULL,
tmax = NULL, xmin = NULL, xmax = NULL, kernel = "epanechnikov",
type = "interior", type.w = "nw", parallel = FALSE,
h.method = "crossval", optim.method = "ga", tol = ifelse(h.method
== "crossval", 10^(-6), 1), run = 2, ...)
|
times |
vector of observed times |
delta |
vector of censoring indicator. 0 - censored, 1 - uncensored (dead) |
covariate |
vector of covariate |
h |
bandwidth vector of length 2, first element is bandwidth for time and second for covariate. If missing, h is found using some bandwidth selection method. |
t |
vector of time points at which estimate is evaluated |
x |
vector of covariate points at which estimate is evaluated |
tx |
data frame of t and x at which estimate is evaluated |
t.length |
number of grid points of time |
x.length |
number of grid points of covariate |
tmin, tmax |
minimum/maximum values for grid of time |
xmin, xmax |
minimum/maximum values for grid of covariate |
kernel |
kernel function, possible values are: "epanechnikov" (default), "gaussian", "rectangular", "quartic". |
type |
Type of kernel estimate. Possible types are: "exterior", "interior" (default). |
type.w |
Type of weights. Default are Nadaraya-Watson weights. |
parallel |
allows parallel computation. Default is FALSE. |
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: "ga"(default). |
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 |
External type of kernel estimator is defined as the ratio of kernel estimator of the conditional subdensity of the uncensored observations to the conditional 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 conditional hazard function.
Returns an object of class 'khazardcond' which is a list with fields
time.points |
vector of time points at which estimate is evaluated |
covariate.points |
vector of covariate points at which estimate is evaluated |
hazard |
matrix of hazard function values on grid or data.frame of time and covariate points and appropriate hazard values if hx is defined |
h |
bandwidth vector |
CVML |
value of crossvalidation or log-likelihood at h |
details |
description of used methods |
GA.result |
output of ga, object of class ga-class |
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.
1 2 | library(survival)
fit<-khazardcond(times = lung$time,delta = lung$status-1,covariate = lung$age,h=c(200,20))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.