This is the key user-facing function for simulating trials.
Usage
simulate_trial(scenario, ...)
# S3 method for hrqolr_scenario
simulate_trial(
scenario,
test_fun = welch_t_test,
n_digits = 2,
valid_hrqol_range = c(-0.757, 1),
alpha = 0.05,
seed = NULL,
...
)
Arguments
- scenario
object of class 'hrqolr_scenario', the output of setup_scenario
- ...
passed on to methods
- test_fun
function used to compare estimates. The default is
welch_t_test
(built intohrqolr
). Note that the function should handle the number of arms provided. See Details below.- n_digits
single integer, the number of decimal places of in the first HRQoL values of patients. More digits will yield greater precision but also cause longer run-times.
- valid_hrqol_range
two-element numeric vector, the lower and upper bounds of valid HRQoL values. The default (
c(-0.757, 1.0)
) corresponds to the Danish EQ-5D-5L index values.- alpha
single numerical value in
[0, 1]
, the desired type 1 error rate used when comparing HRQoL in the arms.- seed
single integer, optional seed for reproducible pseudo-random number generation. Defaults to a deterministic value based on the arguments given (ensuring reproducibility by default).