This function is used to obtain nonparametric estimates of of the sojourn probabilities in the recurrence state in the illness-death model.
sojourn(
formula,
data,
conf = FALSE,
n.boot = 199,
conf.level = 0.95,
z.value,
bw = "dpik",
window = "gaussian",
method.weights = "NW",
method = "LM",
presmooth = FALSE,
cluster = FALSE,
ncores = NULL
)
A formula
object, which must have a survIDM
object as the response on the left of the ~
operator and, if desired,
a term on the right. The term may be a qualitative or quantitative variable.
Without covariates, the right hand side should be ~ 1
.
A data.frame including at least four columns named
time1
, event1
, Stime
and event
, which correspond
to disease free survival time, disease free survival indicator, time to death
or censoring, and death indicator, respectively.
Provides pointwise confidence bands. Defaults to FALSE
.
The number of bootstrap replicates to compute the variance of the non-Markovian estimator. Default is 199.
Level of confidence. Defaults to 0.95 (corresponding to 95%).
The value of the covariate on the right hand side of formula at which the sojourn probabilities are computed. For quantitative covariates, i.e. of class integer and numeric.
A single numeric value to compute a kernel density bandwidth.
Use "dpik"
for the KernSmooth package based selector or "np"
for the 'npudensbw'
function of the np package.
A character string specifying the desired kernel.
See details below for possible options. Defaults to "gaussian"
where the gaussian density kernel will be used.
A character string specifying the desired weights method.
Possible options are "NW"
for the Nadaraya-Watson weights and "LL"
for local linear weights. Defaults to "NW"
.
The method used to compute the sojourn estimates.
Possible options are "LM"
and "Satten-Datta"
.
Defaults to "LM"
.
- A logical value. If TRUE
, the presmoothed landmark
estimator of the sojourn function is computed. Only valid for method = "LM"
.
A logical value. If TRUE
(default), the bootstrap procedure
for the confidence intervals is parallelized. Note that there are
cases (e.g., a low number of bootstrap repetitions) that R will gain in
performance through serial computation. R takes time to distribute tasks
across the processors also it will need time for binding them all together
later on. Therefore, if the time for distributing and gathering pieces
together is greater than the time need for single-thread computing,
it does not worth parallelize.
An integer value specifying the number of cores to be used in
the parallelized procedure. If NULL
(default), the number of cores
to be used is equal to the number of cores of the machine - 1.
#'
An object of class "survIDM"
and one of the following
two classes: "soj"
(Sojourn Time Distribution), and
"sojIPCW"
(Inverse Probability of Censoring Weighting for the Sojourn Time Distribution). Objects are implemented as a list with elements:
data.frame with estimates of the sojourn probabilities.
data.frame with the confidence intervals of the sojourn probabilities.
Level of confidence.
The time for obtaining the estimates of sojourn probabilities.
logical; if FALSE
(default) the pointwise confidence
bands are not given.
The expression of the estimated probability.
The number of levels of the covariate. Provides important information when the covariate at the right hand side of formula is of class factor.
The levels of the qualitative covariate (if it is of class factor) on the right hand side of formula.
A formula object.
A call object.
Possible options for argument window are "gaussian"
,
"epanechnikov"
, "tricube"
, "boxcar"
,
"triangular"
, "quartic"
or "cosine"
.
Satten, G.A. and Datta, S. (2002) Marginal estimation for multi-stage models: waiting time distributions and competing risks analyses. Statistics in Medicine, 21, 3--19.
# NOT RUN {
res <- sojourn(survIDM(time1, event1, Stime, event) ~ 1,
data = colonIDM, conf = FALSE, conf.level = 0.95)
res
summary(res, time=365*1:6)
plot(res)
res1 <- sojourn(survIDM(time1, event1, Stime, event) ~ 1,
data = colonIDM, conf = FALSE, conf.level = 0.95, method = "LM",
presmooth = TRUE)
res1
summary(res1, time=365*1:6)
plot(res1)
# not run:
#res2 <- sojourn(survIDM(time1, event1, Stime, event) ~ 1,
#data = colonIDM, conf = FALSE, conf.level = 0.95, method = "Satten-Datta")
#res2
# with a factor
res3 <- sojourn(survIDM(time1, event1, Stime, event) ~ factor(sex),
data = colonIDM, conf = FALSE, conf.level = 0.95)
res3
summary(res3, time=365*1:6)
plot(res3)
# with a qualitative covariate
res4 <- sojourn(survIDM(time1, event1, Stime, event) ~ age, data = colonIDM,
z.value = 56, conf = FALSE, conf.level = 0.95)
res4
summary(res4, time=365*1:6)
plot(res4)
# }
Run the code above in your browser using DataLab