R/sim.R
sim.Rdsim estimated the operating characteristics (via simulation) of a
design returned by des_one_stage or
des_two_stage, under given response rate scenarios (see
pi).
sim( des = ph2rand::des_one_stage(), pi = des$opchar[, 1:2], k = 1:des$J, replicates = 10000, summary = FALSE )
| des | An object of class |
|---|---|
| pi | A |
| k | A |
| replicates | A |
| summary | A |
A list with additional class "ph2rand_sim",
containing each of the input parameters along with a tibble in the slot
$sim, which gives the estimated operating characteristics.
# The default two-stage design des <- des_two_stage() # Its operating characteristics under the uninteresting and interesting # scenarios sim <- sim(des) # The same operating characteristics, conditioning on the trial ending in # stage 2 sim <- sim(des, k = 2)