Description Usage Arguments Value
Simulation of normally distributed data for Bayesian adaptive trials with various inputs to control for power, sample size, type I error rate, etc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33  normalBACT(
mu_treatment,
sd_treatment,
mu_control = NULL,
sd_control = NULL,
mu0_treatment = NULL,
sd0_treatment = NULL,
N0_treatment = NULL,
mu0_control = NULL,
sd0_control = NULL,
N0_control = NULL,
N_total,
lambda = 0.3,
lambda_time = NULL,
interim_look = NULL,
EndofStudy,
block = 2,
rand_ratio = c(1, 1),
discount_function = "identity",
alternative = "greater",
prop_loss_to_followup = 0.15,
h0 = 0,
futility_prob = 0.05,
expected_success_prob = 0.9,
prob_ha = 0.95,
N_impute = 10,
number_mcmc = 10000,
alpha_max = 1,
fix_alpha = FALSE,
weibull_scale = 0.135,
weibull_shape = 3,
method = "fixed"
)

mu_treatment 
scalar. Mean outcome in the treatment arm. 
sd_treatment 
scalar. Standard deviation of outcome in the treatment 
mu_control 
scalar. Mean outcome in the control arm. 
sd_control 
scalar. Standard deviation of outcome in the control arm. arm. 
mu0_treatment 
scalar. Mean of the historical treatment group. 
sd0_treatment 
scalar. Standard deviation of the historical treatment group. 
N0_treatment 
scalar. Number of observations of the historical treatment group. 
mu0_control 
scalar. Mean of the historical control group. 
sd0_control 
scalar. Standard deviation of the historical control group. 
N0_control 
scalar. Number of observations of the historical control group. 
N_total 
scalar. Total sample size. 
lambda 
vector. Enrollment rates across simulated enrollment times. See

lambda_time 
vector. Enrollment time(s) at which the enrollment rates
change. Must be same length as lambda. See 
interim_look 
vector. Sample size for each interim look. Note: the maximum sample size should not be included. 
EndofStudy 
scalar. Length of the study. 
block 
scalar. Block size for generating the randomization schedule. 
rand_ratio 
vector. Randomization allocation for the ratio of control
to treatment. Integer values mapping the size of the block. See

discount_function 
character. If incorporating historical data, specify
the discount function. Currently supports the Weibull function
( 
alternative 
character. The string specifying the alternative
hypothesis, must be one of 
prop_loss_to_followup 
scalar. Overall oroportion of subjects lost to followup. 
h0 
scalar. Threshold for comparing two mean values. Default is

futility_prob 
scalar. Probability of stopping early for futility. 
expected_success_prob 
scalar. Probability of stopping early for success. 
prob_ha 
scalar. Probability of alternative hypothesis. 
N_impute 
scalar. Number of imputations for Monte Carlo simulation of missing data. 
number_mcmc 
scalar. Number of Monte Carlo Markov Chain draws in sampling posterior. 
alpha_max 
scalar. Maximum weight the discount function can apply. Default is 1. For a twoarm trial, users may specify a vector of two values where the first value is used to weight the historical treatment group and the second value is used to weight the historical control group. 
fix_alpha 
logical. Fix alpha at alpha_max? Default value is FALSE. 
weibull_scale 
scalar. Scale parameter of the Weibull discount function used to compute alpha, the weight parameter of the historical data. Default value is 0.135. For a twoarm trial, users may specify a vector of two values where the first value is used to estimate the weight of the historical treatment group and the second value is used to estimate the weight of the historical control group. Not used when discount_function = "identity". 
weibull_shape 
scalar. Shape parameter of the Weibull discount function used to compute alpha, the weight parameter of the historical data. Default value is 3. For a twoarm trial, users may specify a vector of two values where the first value is used to estimate the weight of the historical treatment group and the second value is used to estimate the weight of the historical control group. Not used when discount_function = "identity". 
method 
character. Analysis method with respect to estimation of the weight
paramter alpha. Default method " 
a list of output for a single trial simulation.
mu_treatment
scalar. The input parameter of mean value of the outcome in the treatment group.
p_control
scalar. The input parameter of mean value of the outcome in the control group.
sd_treatment
scalar. The input parameter of standard deviation of the outcome in the control group.
sd_control
scalar. The input parameter of standard deviation of the outcome in the control group.
prob_of_accepting_alternative
scalar. The input parameter of probability threshold of accepting the alternative.
margin
scalar. The margin input value of difference between mean estimate of treatment and mean estimate of the control.
alternative
character. The input parameter of alternative hypothesis.
interim_look
vector. The sample size for each interim look.
N_treatment
scalar. The number of patients enrolled in the experimental group for each simulation.
N_control
scalar. The number of patients enrolled in the control group for each simulation.
N_enrolled
vector. The number of patients enrolled in the trial (sum of control and experimental group for each simulation. )
N_complete
scalar. The number of patients who completed the trial and had no loss to followup.
post_prob_accept_alternative
vector. The final probability of accepting the alternative hypothesis after the analysis is done.
est_final
scalar. The final estimate of the difference in posterior estimate of treatment and posterior estimate of the control group.
stop_futility
scalar. 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_success
scalar. Did the trial stop for early success during imputation of patient who had loss to follow up? 1 for yes and 0 for no.
est_interim
scalar. The interim estimate of the difference in posterior estimate of treatment and posterior estimate of the control group.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.