Sample size calculation for snSMART with 3 active treatments and a binary outcome
Sample size calculation for snSMART with 3 active treatments and a binary outcome
conduct Bayesian sample size calculation for a snSMART design with 3 active treatments and a binary outcome to distinguish the best treatment from the second-best treatment using the Bayesian joint stage model.
sample_size(pi, beta1, beta0, coverage, power, mu, n, verbose =FALSE)## S3 method for class 'sample_size'summary(object,...)## S3 method for class 'summary.sample_size'print(x,...)## S3 method for class 'sample_size'print(x,...)
Arguments
pi: a vector with 3 values (piA, piB, piC). piA is the the response rate (ranges from 0.01 to 0.99) for treatment A, piB is the response rate (ranges from 0.01 to 0.99) for treatment B, piC is the response rate (ranges from 0.01 to 0.99) for treatment C
beta1: the linkage parameter (ranges from 1.00 to 1/largest response rate) for first stage responders. (A smaller value leads to more conservative sample size calculation because two stages are less correlated)
beta0: the linkage parameter (ranges from 0.01 to 0.99) for first stage non-responders. A larger value leads to a more conservative sample size calculation because two stages are less correlated
coverage: the coverage rate (ranges from 0.01 to 0.99) for the posterior difference of top two treatments
power: the probability (ranges from 0.01 to 0.99) for identify the best treatment
mu: a vector with 3 values (muA, muB, muC). muA is the prior mean (ranges from 0.01 to 0.99) for treatment A, muB is the prior mean (ranges from 0.01 to 0.99) for treatment B, muC is the prior mean (ranges from 0.01 to 0.99) for treatment C
n: a vector with 3 values (nA, nB, nC). nA is the prior sample size (larger than 0) for treatment A. nB is the prior sample size (larger than 0) for treatment B. nC is the prior sample size (larger than 0) for treatment C
verbose: TRUE or FALSE. If FALSE, no function message and progress bar will be printed.
object: object to summarize.
...: further arguments. Not currently used.
x: object to print
Returns
final_N: the estimated sample size per arm for this snSMART
critical_value: critical value based on the provided coverage value
grid_result: for each iteration we calculate l, where l belongs to {2 * (pi_(1) - pi_(2)), ..., 0.02, 0.01}; E(D): the mean of the posterior distribution of D, , where D = pi_(1) = pi_(2); Var(D): the variance of the posterior distribution of D; N: the corresponding sample size; and power: the resulting power of this iteration
Details
Note that this package does not include the JAGS library, users need to install JAGS separately. Please check this page for more details: https://sourceforge.net/projects/mcmc-jags/
This function may take a few minutes to run
Examples
## Not run:# short running time examplesampleSize <- sample_size( pi = c(0.7,0.5,0.25), beta1 =1.4, beta0 =0.5, coverage =0.9, power =0.3, mu = c(0.65,0.55,0.25), n = c(10,10,10))## End(Not run)sampleSize <- sample_size( pi = c(0.7,0.5,0.25), beta1 =1.4, beta0 =0.5, coverage =0.9, power =0.8, mu = c(0.65,0.55,0.25), n = c(4,2,3))
References
Wei, B., Braun, T.M., Tamura, R.N. and Kidwell, K.M., 2018. A Bayesian analysis of small n sequential multiple assignment randomized trials (snSMARTs). Statistics in medicine, 37(26), pp.3723-3732. URL: doi:10.1002/sim.7900
Wei, B., Braun, T.M., Tamura, R.N. and Kidwell, K., 2020. Sample size determination for Bayesian analysis of small n sequential, multiple assignment, randomized trials (snSMARTs) with three agents. Journal of Biopharmaceutical Statistics, 30(6), pp.1109-1120. URL: doi:10.1080/10543406.2020.1815032