Wrapper function for complete binomial and normal function to compute power and type 1 error.
simulate(input, no_of_sim = 10000, .data = NULL)list. Input function for all inputs in binomial and normal .
numeric. Number of simulations to run
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 1 error or the number 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 simulation.
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.