Title: | Phase II Clinical Trial Design Using Bayesian Methods |
---|---|
Description: | Calculate the Bayesian posterior/predictive probability and determine the sample size and stopping boundaries for single-arm Phase II design. |
Authors: | Yalin Zhu, Rui Qin |
Maintainer: | Yalin Zhu <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.4 |
Built: | 2024-11-21 06:07:56 UTC |
Source: | https://github.com/cran/ph2bye |
The ph2bye package provides three categories of important functions: PostP.design, PredP.design and MultPostP.design.
The posterior probability criterion functions include PostP and PostP.design functions.
The predictive probability criterion functions include PredP and PredP.design functions.
The posterior probability criterion functions include MultPostP and MultPostP.design functions.
The criterion function DT.design.
The function prior calculating Beta prior parameters accourding different prior information.
Yalin Zhu <[email protected]>
Make animation plots to present sequential monitor stopping rule using Beta-Binomial Bayesian model
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)
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)
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. |
animation plot of determination of stopping boundaries.
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
# 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)
# 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)
Make animation plots to present sequential monitor the patients using Beta-Binomial Bayesian model
BB.aniplot(a, b, r, N=1, alpha=0.05, seed=1234, time.interval=1, output=TRUE)
BB.aniplot(a, b, r, N=1, alpha=0.05, seed=1234, time.interval=1, output=TRUE)
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. |
animation plot of updating posterior as prior, and output the inference information of prior and posterior distribution if output=TRUE
.
Yin, G. (2012). Clinical Trial Design: Bayesian and Frequentist Adaptive Methods. New York: Wiley.
# 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)
# 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 design function to sequentially monitor sample size and stopping boundary for both futility and efficacy
DT.design(type, a, b, nmin, nmax, p0, p1, theta0, theta1, theta_t, optimize)
DT.design(type, a, b, nmin, nmax, p0, p1, theta0, theta1, theta_t, optimize)
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. |
boundsets |
the boundaries sets: |
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.
## 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,]
## 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,]
Thall, Simon and Estey's criterion function for determining the trial decision boundaries for efficacy (futility) and safety (toxicity).
MultPostP(x, n, a.vec, p0)
MultPostP(x, n, a.vec, p0)
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. |
prob |
the posterior probability: |
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.
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)
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 design function to sequentially monitor sample size and boundary based on Thall, Simon and Estey's criterion.
MultPostP.design(type, nmax, a.vec, p0, theta, optimize)
MultPostP.design(type, nmax, a.vec, p0, theta, optimize)
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 |
boundset |
the boundaries set: |
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.
## 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)
## 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)
Thall and Simon's criterion function for determining the trial decision boundaries based on the posterior probability.
PostP(x, n, a, b, p0)
PostP(x, n, a, b, p0)
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. |
prob |
the posterior probability: |
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.
PostP(8,15,1,1,0.8)
PostP(8,15,1,1,0.8)
The design function to sequentially monitor sample size and boundary based on Thall and Simon's criterion.
PostP.design(type, nmax, a, b, p0, theta, optimize)
PostP.design(type, nmax, a, b, p0, theta, optimize)
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. |
boundset |
the boundaries set: |
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.
## 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)
## 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)
Lee and Liu's criterion function for determining the trial decision cutoffs based on the predictive probability.
PredP(x, n, nmax, a, b, p0, theta_t)
PredP(x, n, nmax, a, b, p0, theta_t)
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, |
prob |
the predictive probability: |
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.
# Using vague prior Uniform(0,1), i.e. Beta(1,1) PredP(16, 23, 40, 1, 1, 0.5, 0.9)
# Using vague prior Uniform(0,1), i.e. Beta(1,1) PredP(16, 23, 40, 1, 1, 0.5, 0.9)
The design function to sequentially monitor sample size and boundary based on Lee and Liu's criterion.
PredP.design(type, nmax, a, b, p0, theta_t, theta, optimize)
PredP.design(type, nmax, a, b, p0, theta_t, theta, optimize)
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. |
boundset |
the boundaries set: |
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.
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)
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)
The prior function to calculate the Beta prior parameters
prior(type, mu, v, N, W, init)
prior(type, mu, v, N, W, init)
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. |
parameters |
the vector of Beta parameters: |
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.
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)
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)