Simulate a multi-state dataset for a 3-state model with sim_mstate3_date() and compute progression-free survival (PFS) and overall survival (OS).

sim_pfs_os_data(n = 2000, seed = NULL)

Arguments

n

The number of patients to simulate.

seed

An integer to pass to set.seed(). If NULL, then no seed is set.

Value

Returns a data.table with one rows for each patient. The returned columns are as follows:

patient_id

The patient ID.

strategy_id

The treatment strategy ID.

strategy_name

The name of the treatment strategy. Either "New or "SOC.

female

1 if female and 0 if male.

age

The age of the patient in years.

pfs_time

Time to progression, death, or right censoring.

pfs_status

1 if a progression or death event occured and 0 if there was right censoring.

os_time

Time to death or right censoring.

os_status

1 if a patient died and 0 if there was right censoring.

Examples

sim_pfs_os_data(n = 3, seed = 101)
#> Error in sim_pfs_os_data(n = 3, seed = 101): could not find function "sim_pfs_os_data"