simulate_study | R Documentation |
Simulate a study
simulate_study(study, theta, a, b, n_draws = 3000)
study |
A study whose phases will be simulated in sequence. |
theta |
A vector of true event probabilities in each arm. |
a, b |
Vectors of parameters to the beta prior with elements for each
arm. Recycled to match the length of |
n_draws |
The number of draws to sample from the posterior for evaluating posterior probabilities in allocation rules. |
study for options for study types. phase()
for defining study
phases. allocation_rule for available rules for treatment allocation.
# A single-phase study uses the same allocation rule throughout simulate_study( single_phase_study(n = 240, rule = rule_1(epsilon = 0.1)), a = 1, b = 1, theta = 0.2 + 1:4 / 10 ) # A multi-phase study can e.g. have a burn-in period with another rule simulate_study( multi_phase_study(phases = list( phase(n = 40, rule = randomization_list()), phase(n = 200, rule = rule_1(epsilon = 0.1)) )), a = 1, b = 1, theta = 0.2 + 1:4 / 10 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.