View source: R/generate_data.R
generate_data | R Documentation |
This generates the dataset denoted by S1
in Table 4 of
\insertCitestegherr_estimating_2021;textualsavvyr,
i.e. we assume constant hazards for the adverse event (AE) hazard, the
hazard for the competing event of death, and the hazard for the "soft"
competing events. Censoring is uniform in the given range.
generate_data(n, cens, haz_ae, haz_death, haz_soft)
n |
( |
cens |
( |
haz_ae |
( |
haz_death |
( |
haz_soft |
( |
(data.frame
)
a data.frame
with the following columns:
id
: Patient ID.
time_to_event
: Time to the first AE, death or soft competing event.
type_of_event
: 0 for censored, 1 for AE, 2 for death, 3 for soft
competing event.
cens
: Censoring time.
stegherr_estimating_2021savvyr
set.seed(123)
generate_data(n = 5, cens = c(2, 5), haz_ae = 2, haz_death = 3, haz_soft = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.