Type: | Package |
Title: | Phase II Clinical Trial Design Using Bayesian Methods |
Version: | 0.1.4 |
Author: | Yalin Zhu, Rui Qin |
Maintainer: | Yalin Zhu <yalin.zhu@outlook.com> |
Description: | Calculate the Bayesian posterior/predictive probability and determine the sample size and stopping boundaries for single-arm Phase II design. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
URL: | https://allen.shinyapps.io/BayesDesign/ |
LazyData: | TRUE |
Depends: | stats, graphics, animation, nleqslv |
Imports: | Rcpp, VGAM |
Suggests: | clinfun, gsDesign, survival |
LinkingTo: | Rcpp |
RoxygenNote: | 5.0.1 |
NeedsCompilation: | yes |
Packaged: | 2016-08-21 19:51:00 UTC; yalin.zhu |
Repository: | CRAN |
Date/Publication: | 2016-08-21 22:11:03 |
ph2bye: A package for Phase II single-arm Bayesian design.
Description
The ph2bye package provides three categories of important functions: PostP.design, PredP.design and MultPostP.design.
Posterior probability criterion functions
The posterior probability criterion functions include PostP and PostP.design functions.
Predictive probability criterion functions
The predictive probability criterion functions include PredP and PredP.design functions.
Posterior probability criterion function for multiple outcomes
The posterior probability criterion functions include MultPostP and MultPostP.design functions.
Whole design function with double thresholds showing futility and efficacy boundary together
The criterion function DT.design.
Prior calculation function
The function prior calculating Beta prior parameters accourding different prior information.
Author(s)
Yalin Zhu <yalin.zhu@outlook.com>
Sequentially monitor patients using Beta-Binomial posterior probability
Description
Make animation plots to present sequential monitor the patients using Beta-Binomial Bayesian model
Usage
BB.aniplot(a, b, r, N=1, alpha=0.05, seed=1234, time.interval=1, output=TRUE)
Arguments
a |
the hyperparameter (shape1) of the Beta prior for the experimental drug. |
b |
the hyperparameter (shape2) of the Beta prior for the experimental drug. |
r |
vector of number of response in each cohort, the value of each element should not exceed N |
N |
the number of patients treated by the experimental drug at a certain stage of the trial. |
alpha |
the siginificant level to determine the credible interval, set 0.05 by default. |
seed |
a single integer value, random number generator (RNG) state for random number generation. |
time.interval |
a positive number to set the time interval of the animation (unit in seconds); default to be 1. |
output |
a logical value, whether to output the inference results of posterior distribution and mean, observed data and credible interval. |
Value
animation plot of updating posterior as prior, and output the inference information of prior and posterior distribution if output=TRUE
.
References
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
# Using APL data
r=rep(0,6)
BB.aniplot(a=1,b=1,r=r, alpha=0.05, seed=1234)
# Simulate binomial data
B <- 10; N=1; p=0.3
r <- rbinom(n = B,size = N,prob = p)
BB.aniplot(a=1,b=1,r=r,time.interval = 0.2,output = FALSE)
The whole design with double thresholds showing futility and efficacy boundary together
Description
The design function to sequentially monitor sample size and stopping boundary for both futility and efficacy
Usage
DT.design(type, a, b, nmin, nmax, p0, p1, theta0, theta1, theta_t, optimize)
Arguments
type |
type of stopping criterion: "PostP" or "PredP". |
a |
the hyperparameter (shape1) of the Beta prior for the experimental drug. |
b |
the hyperparameter (shape2) of the Beta prior for the experimental drug. |
nmin |
the minimum number of patients treated by the experimental drug. |
nmax |
the maximum number of patients treated by the experimental drug. |
p0 |
the pre-specified reseponse rate. |
p1 |
the pre-specified reseponse rate. |
theta0 |
the cutoff probability for futility: typically, |
theta1 |
the cutoff probability for efficacy: typically, |
theta_t |
the cutoff probability for efficacy including future patients; typically, |
optimize |
logical value, if optimize=TRUE, then only output the minimal sample size for the same number of futility and efficacy boundaries. |
Value
boundsets |
the boundaries sets: |
References
Thall, P. F., Simon, R. (1994). Practical Bayesian guidelines for phase IIB clinical trials. Biometrics 50: 337-349.
Lee, J. J., Liu, D. D. (2008). A predictive probability design for phase II cancer clinical trials. Clinical Trials 5: 93-106.
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
## Using vague prior Unif(0,1), sequential monitor
DT.design(type = "PostP", a=1, b=1, nmin=20, nmax=60, p0=0.4, p1=0.3, theta0 = 0.05, theta1 = 0.9)
DT.design(type = "PredP", a=1, b=1, nmin=20, nmax=60, p0=0.4, p1=0.3, theta0 = 0.05, theta1 = 0.9,
theta_t = 0.9)
## Or using Jeffery prior with Beta(0.5,0.5), multi-stage monitor when sample size is
## 10, 20, ..., 80
DT.design(type = "PostP", a=0.5, b=0.5, nmin=1, nmax=85, p0=0.3, p1=0.3, theta0 = 0.05,
theta1 = 0.9)[(1:8)*10,]
DT.design(type = "PredP", a=0.5, b=0.5, nmin=1, nmax=85, p0=0.3, p1=0.3, theta0 = 0.05,
theta1 = 0.9, theta_t = 0.9)[(1:8)*10,]
The posterior probability criterion function for Phase II single-arm design
Description
Thall, Simon and Estey's criterion function for determining the trial decision boundaries for efficacy (futility) and safety (toxicity).
Usage
MultPostP(x, n, a.vec, p0)
Arguments
x |
the value of observed data. It can be |
n |
the number of patients treated by the experimental drug at a certain stage of the trial. |
a.vec |
the hyperparameter vector of the Dirichlet prior for the experimental drug. |
p0 |
the prespecified reseponse rate for efficacy, futility or toxicity. |
Value
prob |
the posterior probability: |
References
Berry, S. M., Carlin, B. P., Lee, J. J., & Muller, P. (2010). Bayesian adaptive methods for clinical trials. CRC press.
Thall, Peter F., Richard M. Simon, and Elihu H. Estey. (1995). Bayesian sequential monitoring designs for single-arm clinical trials with multiple outcomes. Statistics in medicine 14.4: 357-379.
Yin, G. (2013). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
n <- 30; x.eff <- 5; x.tox <- 8; param <- c(1,1,1,1); p0.eff <- 0.9; p0.tox <- 0.95
MultPostP(x=x.eff, n=n, a.vec=param, p0=p0.eff)
MultPostP(x=x.tox, n=n, a.vec=param, p0=p0.tox)
The stopping boundaries based on the multiple outcomes criterion
Description
The design function to sequentially monitor sample size and boundary based on Thall, Simon and Estey's criterion.
Usage
MultPostP.design(type, nmax, a.vec, p0, theta, optimize)
Arguments
type |
type of boundaries: "efficacy" or "futility" or "toxicity". |
nmax |
the maximum number of patients treated by the experimental drug. |
a.vec |
the hyperparameter vector of the Dirichlet prior for the experimental drug. |
p0 |
the prespecified reseponse rate for efficacy or toxicity. |
theta |
the cutoff probability: typically, |
optimize |
logical value, if optimize=TRUE, then only output the minimal sample size for the same number of futility boundaries and maximal sample size for the same number efficacy boundaries |
Value
boundset |
the boundaries set: |
References
Thall, Peter F., Richard M. Simon, and Elihu H. Estey. (1995). Bayesian sequential monitoring designs for single-arm clinical trials with multiple outcomes. Statistics in medicine 14.4: 357-379.
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
## Using vague prior Unif(0,1)
MultPostP.design(type="futility",nmax = 30,a.vec = c(1,1,1,1),p0 = 0.15, theta = 0.05)
MultPostP.design(type="efficacy",nmax = 30,a.vec = c(1,1,1,1),p0 = 0.15, theta = 0.9)
MultPostP.design(type="toxicity",nmax = 30,a.vec = c(1,1,1,1),p0 = 0.15, theta = 0.95)
The posterior probability criterion function for Phase II single-arm design
Description
Thall and Simon's criterion function for determining the trial decision boundaries based on the posterior probability.
Usage
PostP(x, n, a, b, p0)
Arguments
x |
the number of responses among |
n |
the number of patients treated by the experimental drug. |
a |
the hyperparameter (shape1) of the Beta prior for the experimental drug. |
b |
the hyperparameter (shape2) of the Beta prior for the experimental drug. |
p0 |
the prespecified reseponse rate. |
Value
prob |
the posterior probability: |
References
Berry, S. M., Carlin, B. P., Lee, J. J., & Muller, P. (2010). Bayesian adaptive methods for clinical trials. CRC press.
Thall, P. F., Simon, R. (1994). Practical Bayesian guidelines for phase IIB clinical trials. Biometrics 50: 337-349.
Yin, G. (2013). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
PostP(8,15,1,1,0.8)
The stopping boundaries based on the posterior probability criterion
Description
The design function to sequentially monitor sample size and boundary based on Thall and Simon's criterion.
Usage
PostP.design(type, nmax, a, b, p0, theta, optimize)
Arguments
type |
type of boundaries: "efficacy" or "futility". |
nmax |
the maximum number of patients treated by the experimental drug. |
a |
the hyperparameter (shape1) of the Beta prior for the experimental drug. |
b |
the hyperparameter (shape2) of the Beta prior for the experimental drug. |
p0 |
the pre-specified reseponse rate. |
theta |
the cutoff probability: typically, |
optimize |
logical value, if optimize=TRUE, then only output the minimal sample size for the same number of futility and efficacy boundaries. |
Value
boundset |
the boundaries set: |
References
Thall, P. F., Simon, R. (1994). Practical Bayesian guidelines for phase IIB clinical trials. Biometrics 50: 337-349.
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
## Using vague prior Unif(0,1)
PostP.design(type = "futility", nmax=100, a=1, b=1, p0=0.3, theta=0.05)
PostP.design(type = "efficacy", nmax=100, a=1, b=1, p0=0.3, theta=0.9)
## Or using Jeffery prior with Beta(0.5,0.5)
PostP.design(type = "futility", nmax=100, a=0.5, b=0.5, p0=0.3, theta=0.05)
PostP.design(type = "efficacy", nmax=100, a=0.5, b=0.5, p0=0.3, theta=0.9)
The predictive probability criterion function for Phase II single-arm design
Description
Lee and Liu's criterion function for determining the trial decision cutoffs based on the predictive probability.
Usage
PredP(x, n, nmax, a, b, p0, theta_t)
Arguments
x |
the number of responses among |
n |
the number of patients treated by the experimental drug at a certain stage of the trial. |
nmax |
the maximum number of patients treated by the experimental drug. |
a |
the hyperparameter (shape1) of the Beta prior for the experimental drug. |
b |
the hyperparameter (shape2) of the Beta prior for the experimental drug. |
p0 |
the the response rate for the standard drug. |
theta_t |
the cutoff probability for efficacy including future patients; typically, |
Value
prob |
the predictive probability: |
References
Lee, J. J., Liu, D. D. (2008). A predictive probability design for phase II cancer clinical trials. Clinical Trials 5: 93-106.
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
# Using vague prior Uniform(0,1), i.e. Beta(1,1)
PredP(16, 23, 40, 1, 1, 0.5, 0.9)
The stopping boundaries based on the predictive probability criterion
Description
The design function to sequentially monitor sample size and boundary based on Lee and Liu's criterion.
Usage
PredP.design(type, nmax, a, b, p0, theta_t, theta, optimize)
Arguments
type |
type of boundaries: "efficacy" or "futility". |
nmax |
the maximum number of patients treated by the experimental drug. |
a |
the hyperparameter (shape1) of the Beta prior for the experimental drug. |
b |
the hyperparameter (shape2) of the Beta prior for the experimental drug. |
p0 |
the the response rate for the standard drug. |
theta_t |
the cutoff probability for efficacy including future patients; typically, |
theta |
the cutoff probability: typically, |
optimize |
logical value, if optimize=TRUE, then only output the minimal sample size for the same number of futility and efficacy boundaries. |
Value
boundset |
the boundaries set: |
References
Lee, J. J., Liu, D. D. (2008). A predictive probability design for phase II cancer clinical trials. Clinical Trials 5: 93-106.
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
PredP.design(type = "futility", nmax=40, a=1, b=1, p0=0.3, theta=0.05)
PredP.design(type = "efficacy", nmax=40, a=1, b=1, p0=0.3, theta=0.9)
Bayesian design method for sequentially monitoring patients using Beta-Binomial posterior probability based on observing data
Description
Make animation plots to present sequential monitor stopping rule using Beta-Binomial Bayesian model
Usage
bayes.design(a,b,r=0, stop.rule="futility", add.size=5, alpha=0.05,
p0 ,delta=0.2,tau1=0.9,tau2=0.9,tau3=0.9,tau4=0.9, time.interval =1)
Arguments
a |
the hyperparameter (shape1) of the Beta prior for the experimental drug. |
b |
the hyperparameter (shape2) of the Beta prior for the experimental drug. |
r |
the maximum number of patients treated by the experimental drug. |
stop.rule |
the hyperparameter (shape1) of the Beta prior for the experimental drug. |
add.size |
a single integer value, random number generator (RNG) state for random number generation. |
alpha |
the siginificant level to determine the credible interval, set 0.05 by default. |
p0 |
the prespecified reseponse rate. |
delta |
the minimally acceptable increment of the response rate. |
tau1 |
threshold for stopping rule 1. |
tau2 |
threshold for stopping rule 2. |
tau3 |
threshold for stopping rule 3. |
tau4 |
threshold for stopping rule 4. |
time.interval |
a positive number to set the time interval of the animation (unit in seconds); default to be 1. |
Value
animation plot of determination of stopping boundaries.
References
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
Examples
# Using Multiple Myeloma (MM) data example
MM.r = rep(0,6); MM.mean = 0.1; MM.var = 0.0225
a <- MM.mean^2*(1-MM.mean)/MM.var - MM.mean; b <- MM.mean*(1-MM.mean)^2/MM.var - (1-MM.mean)
bayes.design(a=a,b=b,r=MM.r,stop.rule="futility",p0=0.1)
# Using Acute Promyelocytic Leukaemia (APL) data example
APL.r <- c(0,1,0,0,1,1); APL.mean = 0.3; APL.var = 0.0191
a <- APL.mean^2*(1-APL.mean)/APL.var - APL.mean; b <- APL.mean*(1-APL.mean)^2/APL.var - (1-APL.mean)
bayes.design(a=a,b=b,r=APL.r,stop.rule="efficacy",p0=0.1)
Beta priors determination based on different prior information
Description
The prior function to calculate the Beta prior parameters
Usage
prior(type, mu, v, N, W, init)
Arguments
type |
type of prior information: "MeanVar" uses mean and variance, "Optimist" uses (ORR) mean, "ORRN" uses ORR and smaple size, "ORRW" uses ORR and CI width. |
mu |
prior(ORR) mean. |
v |
prior variance |
N |
prior sample size. |
W |
prior confidence interval width. |
init |
initial value to solve the nonlinear equations for "ORRW" type. |
Value
parameters |
the vector of Beta parameters: |
References
Thall, P. F., Simon, R. (1994). Practical Bayesian guidelines for phase IIB clinical trials. Biometrics 50: 337-349.
Mayo, M. S., & Gajewski, B. J. (2004). Bayesian sample size calculations in phase II clinical trials using informative conjugate priors. Controlled clinical trials 25(2): 157-167.
Tan, S. B., & Machin, D. (2002). Bayesian two-stage designs for phase II clinical trials. Statistics in medicine 21(14): 1991-2012. New York: Wiley.
Examples
prior(type = "MeanVar", mu=0.2, v=0.025)
prior(type = "Optimist", mu = 0.2)
prior(type = "ORRN", mu = 0.2, N = 10)
prior(type = "ORRW", mu = 0.2, W = 0.5)