Description Usage Arguments Value Examples
This function simulates component-wise censored data from an irreversible or reversible illness-death model. The data is component-wise censored because illness status is intermittently observed at visits, while vital status (alive/dead) is fully observed until right censoring time. All individuals start alive and illness-free. Time from state entry to transition is simulated from a Weibull distribution with user-specified parameters, and the user specifies the visit process.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | simdat(
n,
scale12 = 1/8e-04,
scale13 = 1/2e-04,
scale23 = 1/0.0016,
shape12 = 1,
shape13 = 1,
shape23 = 1,
scale21 = NULL,
shape21 = 1,
vital.lfu = c(30.4 * 36, 30.4 * 48),
dropout.rate = NULL,
visit.schedule = 30.4 * c(6, 12, 18, 24, 30, 36, 42, 48),
scatter.sd = 10,
missing.rate = 0,
visit.rate = NULL,
renew.param = NULL,
visit.postprog = 1,
dependent.visit = NULL,
seed = NULL
)
|
n |
sample size |
scale12 |
The model has states 1, 2 and 3 representing illness free,
alive with illness, and death. |
scale13 |
the scale parameter for the Weibull distribution used to generate the time from entry in state 1 until transition to state 3. Default is 1/0.0002. |
scale23 |
the scale parameter for the Weibull distribution used to generate the time from entry in state 2 until transition to state 3. Default is 1/0.0016. |
shape12 |
the shape parameter for the Weibull distribution used to generate the time from entry in state 1 until transition to state 2. Default is 1. |
shape13 |
the shape parameter for the Weibull distribution used to generate the time from entry in state 1 until transition to state 3. Default is 1. |
shape23 |
the shape parameter for the Weibull distribution used to generate the time from entry in state 2 until transition to state 3. Default is 1. |
scale21 |
the scale parameter for the Weibull
distribution used to generate the time from entry in state 2 until transition to state 1.
Default is |
shape21 |
the shape parameter for the Weibull distribution used to generate the time from entry in state 2 until transition to state 1. Default is 1. |
vital.lfu |
defines the right censoring time or distribution. If |
dropout.rate |
controls dropout. Default is |
visit.schedule |
exactly one of |
scatter.sd |
the standard deviation of the truncated normal distribution used to generate visit times |
missing.rate |
a vector of the same length as |
visit.rate |
exactly one of |
renew.param |
exactly one of |
visit.postprog |
if equal to 0, visits stop once illness is observed at a visit. If equal to 1, visits continue as normal. The default is 1. |
dependent.visit |
If |
seed |
If |
A dataframe with one row per individual with the variables dtime
,
dstatus
, state2obs
, laststate1
, t1
-tm
, x1
-
xm
, and nvisits
.
nvisits
and m
are the largest number of visits observed in the dataset.
dstatus=1
represents death and dstatus=0
represents right censoring.
ti
and xi
are the time and observed status at the i
-th visit.
xi=1
means alive and event free (state 1 in a multistate illness-death model),
and xi=2
means alive with event. state2obs
is the time of the first visit
in state 2 (Inf
if state 2 was never observed) and laststate1
is the time
of the last observation in state 1 before state 2 was observed (0
if an
individual was already in state 2 at the first visit). Visits are numbered by
ascending time and missing visits do not get a placeholder. That is, if
visit.schedule
was 30, 60, 90 and 120 days, but the actual visit times
for an individual were 45,40, NA, 125
because of normal scatter and missing visits,
the entries t1-t4
will be 40, 45, 125, NA
.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.