Simulate example multi-state data for a 3-state model using Weibull distributions for each transition. Patients are right censored after 15 years of followup.
sim_mstate3_data(n = 2000, seed = NULL)
n | The number of patients to simulate. |
---|---|
seed | An integer to pass to |
Returns a data.table
with multiple rows for patient. That is,
for a given patient there are rows for each possible transition from a given
health state. The returned columns are as follows:
The health state ID transitioned from.
he health state ID transitioned to.
1
if female and 0
if male.
The age of the patient in years.
The patient ID.
An indicator equal to 1 if a patient is in their final health state during the simulation and 0 otherwise.
The time at the start of the interval.
The time and the end of the interval.
The duration of the interval: time_stop
- time_start
.
1
if time
is an observed transition and 0
if there was
right censoring.
The transition ID representing a unique transition from
from
to to
.
The treatment strategy ID.
The name of the treatment strategy. Either "New
or "SOC
.
sim_mstate3_data(n = 3, seed = 101)#> Error in sim_mstate3_data(n = 3, seed = 101): could not find function "sim_mstate3_data"