Description Usage Arguments Value Examples
This function implements the non-parametric kernel estimator of the probability in state and restricted mean time in state in an illness-death model with component-wise censoring, based on the method of Sun, Huang and Wang (2017).
1 2 3 4 5 6 7 8 9 10 11 12 13 | kernel.est(
dat,
bandwidth,
tau2,
prob.times = NULL,
mu.times = NULL,
boundary = "boundary.kernel",
kfun = "epanechnikov",
std.err = "none",
B = 50,
boot.seed = NULL,
scale = 1
)
|
dat |
a dataframe with one row per individual with the variables
|
bandwidth |
specifies the bandwidth to be used for the kernel estimator.
This can be selected data-adaptively using the |
tau2 |
the maximum time that individuals were at risk for a visit, based on the study design. |
prob.times |
a vector of times at which probability in state will be estimated |
mu.times |
a vector of restriction times at which restricted mean time in state will be estimated |
boundary |
specifies how kernel estimation is done in the left boundary region
from zero to the bandwidth. The default is |
kfun |
specifies the kernel function to be used for estimation. The default
is |
std.err |
If |
B |
the number of bootstrap samples; the default value of 50 for the sake of computation time, but we recommend increasing it |
boot.seed |
If |
scale |
a scaling factor for the restricted mean time in state output. For example,
if times are in days and you want the output to reflect restricted mean years in state,
set |
A list with up to two elements: an element called prob.info
if prob.times
was non-null,
and an element called mu.info
if mu.times
was non-null. prob.info
contains
probability in state estimates and mu.info
contains restricted mean time
in state estimates.
The columns in prob.info
are t, p1, p2, p3
for time and
probability in state 1, 2 and 3, respectively. If std.err ='boot'
or
'asymptotic'
, additional columns are added with standard error estimates
and lower and upper limits of the 95% confidence interval for each estimate.
The columns in mu.info
are analogous.
1 2 3 4 5 6 | mydat <- simdat(50, scale12=1/.0008, scale13=1/.0002, scale23=1/.0016,
vital.lfu=c(30.4*36, 30.4*48),
visit.schedule = 30.4*c(6, 12, 18, 24, 30, 36, 42, 48), scatter.sd=10)
kernel.est(mydat, bandwidth=12*30.4, tau2=30.4*48, prob.times=30.4*48, mu.times=30.4*48,
boundary = 'boundary.kernel', kfun='epanechnikov',
std.err='none', scale=12*30.4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.