Function to simulate patient level data for a normally distributed endpoint
Usage
simulateData(
n_patients,
dose_levels,
sd,
mods,
n_sim = 1000,
true_model = NULL,
dr_means = NULL
)
Arguments
- n_patients
Vector containing number of patients as a numerical value per dose-group.
- dose_levels
Vector containing the different dosage levels.
- sd
Standard deviation on patient level.
- mods
An object of class "Mods" as specified in the DoseFinding package.
- n_sim
Number of simulations to be performed, Default is 1000
- true_model
Default value is NULL. Assumed true underlying model. Provided via a String. e.g. "emax". In case of NULL, all dose-response models, included in the mods input parameter will be used.
- dr_means
a vector, with information about assumed effects per dose group. Default NULL.
Value
A list object, containing patient level simulated data for all assumed true models. Also providing information about simulation iteration, patient number as well as dosage levels.
Examples
models <- DoseFinding::Mods(linear = NULL,
linlog = NULL,
emax = c(0.5, 1.2),
exponential = 2,
doses = c(0, 0.5, 2,4, 8),
maxEff = 6)
dose_levels <- c(0, 0.5, 2,4, 8)
sd <- 12
n_patients <- c(40, 60, 60, 60, 60)
sim_data <- simulateData(n_patients = n_patients,
dose_levels = dose_levels,
sd = sd,
mods = models,
n_sim = 100)
head(sim_data)
#> simulation ptno dose linear linlog emax1 emax2
#> X0 1 1 0 -19.531502 -19.531502 -19.531502 -19.531502
#> X0.1 1 2 0 11.716853 11.716853 11.716853 11.716853
#> X0.2 1 3 0 -8.250778 -8.250778 -8.250778 -8.250778
#> X0.3 1 4 0 26.637564 26.637564 26.637564 26.637564
#> X0.4 1 5 0 -7.299082 -7.299082 -7.299082 -7.299082
#> X0.6 1 6 0 12.391500 12.391500 12.391500 12.391500
#> exponential
#> X0 -19.531502
#> X0.1 11.716853
#> X0.2 -8.250778
#> X0.3 26.637564
#> X0.4 -7.299082
#> X0.6 12.391500