Simulate a realistic example dataset using simulate_data() with hard-coded
values of all the input arguments.
Value
A data.frame of simulated longitudinal trial data (as produced by
simulate_data()) with 100 subjects per group across 7 visits, suitable for
demonstrating the rbmi workflow. It contains the subject id, group, visit,
outcome and covariate columns together with the intercurrent-event and
missingness indicators generated by the simulation.
Details
get_example_data() simulates a 1:1 randomized trial of
an active drug (intervention) versus placebo (control) with 100 subjects per
group and 6 post-baseline assessments (bi-monthly visits until 12 months).
One intercurrent event corresponding to treatment discontinuation is also simulated.
Specifically, data are simulated under the following assumptions:
The mean outcome trajectory in the placebo group increases linearly from 50 at baseline (visit 0) to 60 at visit 6, i.e. the slope is 10 points/year.
The mean outcome trajectory in the intervention group is identical to the placebo group up to visit 2. From visit 2 onward, the slope decreases by 50% to 5 points/year.
The covariance structure of the baseline and follow-up values in both groups is implied by a random intercept and slope model with a standard deviation of 5 for both the intercept and the slope, and a correlation of 0.25. In addition, an independent residual error with standard deviation 2.5 is added to each assessment.
The probability of study drug discontinuation after each visit is calculated according to a logistic model which depends on the observed outcome at that visit. Specifically, a visit-wise discontinuation probability of 2% and 3% in the control and intervention group, respectively, is specified in case the observed outcome is equal to 50 (the mean value at baseline). The odds of a discontinuation is simulated to increase by +10% for each +1 point increase of the observed outcome.
Study drug discontinuation is simulated to have no effect on the mean trajectory in the placebo group. In the intervention group, subjects who discontinue follow the slope of the mean trajectory from the placebo group from that time point onward. This is compatible with a copy increments in reference (CIR) assumption.
Study drop-out at the study drug discontinuation visit occurs with a probability of 50% leading to missing outcome data from that time point onward.
Examples
set.seed(1974)
dat <- get_example_data()
head(dat)
#> id visit group outcome_bl outcome_noICE ind_ice1 ind_ice2 dropout_ice1
#> 1 id_1 0 Control 50.85458 50.85458 0 0 0
#> 2 id_1 1 Control 50.85458 53.65971 0 0 0
#> 3 id_1 2 Control 50.85458 52.99386 0 0 0
#> 4 id_1 3 Control 50.85458 59.01861 0 0 0
#> 5 id_1 4 Control 50.85458 54.69410 0 0 0
#> 6 id_1 5 Control 50.85458 57.31806 0 0 0
#> outcome
#> 1 50.85458
#> 2 53.65971
#> 3 52.99386
#> 4 59.01861
#> 5 54.69410
#> 6 57.31806
