Wrapper function for complete binomial and normal function to compute power and type I error.
simulate(input, no_of_sim = 10000, .data = NULL)
| input | list. Input function for all inputs in binomial, normal, and survival. |
|---|---|
| no_of_sim | numeric. Number of simulations to run. |
| .data | NULL. Stores the proportion of control and treatment, please do not fill it in. |
A list with results of the simulation (power and type I error) and the input.
inputA list of input values used in the trial simulation.
powerdata frame. A data frame with the interim look and power at each look.
type1_errorscalar. The type I error or the proportion of times the trial rejects the null when the parameters are simulated under the null hypothesis.
est_finalvector. The final estimate of the difference in posterior estimate of treatment and posterior estimate of the control group for all the simulations.
post_prob_accept_alternativevector. The final probability of accepting the alternative for the simulations.
N_enrolledvector. The number of patients enrolled in the trial (sum of control and experimental group for each simulation).
stop_futilityvector. Did the trial stop for futility during imputation of patient who had loss to follow up? 1 for yes and 0 for no.
stop_expected_successvector. Did the trial stop for early success during imputation of patient who had loss to follow up? 1 for yes and 0 for no.