Title: | Bayesian Adaptive Designs for Phase II Trials with Binary Endpoint |
---|---|
Description: | Tools and workflow to choose design parameters in Bayesian adaptive single-arm phase II trial designs with binary endpoint (response, success) with possible stopping for efficacy and futility at interim analyses. Also contains routines to determine and visualize operating characteristics. See Kopp-Schneider et al. (2018) <doi:10.1002/bimj.201700209>. |
Authors: | Annette Kopp-Schneider, Manuel Wiesenfarth, Ulrich Abel |
Maintainer: | Manuel Wiesenfarth <[email protected]> |
License: | GPL-2 |
Version: | 0.1.3 |
Built: | 2024-10-30 04:46:10 UTC |
Source: | https://github.com/wiesenfa/bdp2 |
Tools and workflow to choose design parameters in Bayesian adaptive single-arm phase II trial designs with binary endpoint (response, success) with possible stopping for efficacy and futility at interim analyses. Also contains routines to determine and visualize operating characteristics. See Kopp-Schneider et al. (2018) <doi:10.1002/bimj.201700209>.
The DESCRIPTION file:
Package: | BDP2 |
Type: | Package |
Title: | Bayesian Adaptive Designs for Phase II Trials with Binary Endpoint |
Version: | 0.1.3 |
Date: | 2018-07-31 |
Author: | Annette Kopp-Schneider, Manuel Wiesenfarth, Ulrich Abel |
Maintainer: | Manuel Wiesenfarth <[email protected]> |
Description: | Tools and workflow to choose design parameters in Bayesian adaptive single-arm phase II trial designs with binary endpoint (response, success) with possible stopping for efficacy and futility at interim analyses. Also contains routines to determine and visualize operating characteristics. See Kopp-Schneider et al. (2018) <doi:10.1002/bimj.201700209>. |
License: | GPL-2 |
Depends: | rmarkdown, shiny, shinyBS |
LazyData: | TRUE |
Suggests: | knitr |
VignetteBuilder: | knitr |
Repository: | https://wiesenfa.r-universe.dev |
RemoteUrl: | https://github.com/wiesenfa/bdp2 |
RemoteRef: | HEAD |
RemoteSha: | f674d39ef8686ab7a7cfe7e2c969ace4e2dbdb76 |
Index of help topics:
BDP2 Operating characteristics of a single-arm trial with a binary endpoint BDP2-package Bayesian Adaptive Designs for Phase II Trials with Binary Endpoint BDP2_simulate Simulated operating characteristics of a single-arm trial with a binary endpoint for different types of futility criteria BDP2_simulateEF_PredPow internal functions BDP2workflow Shiny app for workflow crit_general Calculates CritBoundaries for different types of futility criteria pFstop Operating characteristics of a single-arm trial with a binary endpoint with futility stopping pFstopEcall operating characteristics of a single-arm trial with a binary endpoint with futility stopping and calling efficacy at interim pFstopEstop Operating characteristics of a single-arm trial with a binary endpoint with stopping for futility and stopping for efficacy plot.cE_vs_pEcall Plot objects returned by plotBDP2() plotBDP2 Plots
Tools and workflow to choose design parameters in Bayesian adaptive single-arm phase II trial designs with binary endpoint (response, success) with possible stopping for efficacy and futility at interim analyses. Also contains routines to determine and visualize operating characteristics.
Main functions: BDP2workflow
, BDP2
and plotBDP2
. BDP2workflow
provides an interactive shiny app which also generates Word/pdf/html reports.
Annette Kopp-Schneider, Manuel Wiesenfarth, Ulrich Abel
Maintainer: Manuel Wiesenfarth <[email protected]>
Kopp-Schneider, A., Wiesenfarth, M., Witt, R., Edelmann, D., Witt, O. and Abel, U. (2018).
Monitoring futility and efficacy in phase II trials with Bayesian
posterior distributions - a calibration approach.
Biometrical Journal, to appear.
## Not run: # Starts Shiny app BDP2workflow() ## End(Not run)
## Not run: # Starts Shiny app BDP2workflow() ## End(Not run)
Determines the operating characteristics of a single-arm trial with a binary endpoint (response, success) and interim efficacy and futility analyses. Declaration of efficacy and futility (including possibly early stopping) is based on the posterior probability that the true response rate is at least pE , pF respectively.
BDP2(n, interim.at, ptrue, eff.stop = FALSE, pF, cF, pE = NULL, cE = NULL, type="PostProb", alpha=0.05, shape1F, shape2F, shape1E = NULL, shape2E = NULL, simulate = FALSE, nsim = 10000)
BDP2(n, interim.at, ptrue, eff.stop = FALSE, pF, cF, pE = NULL, cE = NULL, type="PostProb", alpha=0.05, shape1F, shape2F, shape1E = NULL, shape2E = NULL, simulate = FALSE, nsim = 10000)
n |
sample size at the final analysis |
interim.at |
vector of sample sizes at the interim analyses |
ptrue |
true (assumed) response rate used for analytical evaluations or simulating the trial |
eff.stop |
|
pF |
response rate used for the futility criterion (may be identical to pE) |
cF |
critical level of posterior probabilities used for declaring futility |
pE |
response rate used for the efficacy criterion |
cE |
critical level of posterior probabilities used for declaring efficacy |
type |
"PostProb" for decisions based on posterior probabilities (default) or "PredictivePower" for decisions based on predictive power (currently only implemented for |
alpha |
significance level for final test (only for |
shape1F |
first parameter of the Beta prior for futility analysis |
shape2F |
second parameter of the Beta prior for futility analysis |
shape1E |
first parameter of the Beta prior for efficacy analysis |
shape2E |
second parameter of the Beta prior for efficacy analysis |
simulate |
|
nsim |
number of simulation runs (only used if |
Assumptions: Endpoint (response/no response) data available for all study patients. Beta-binomial model. Prior distribution = Beta(shape1, shape2).
The posterior distribution at interim analysis with n.int patients and k.int successes is Beta(k.int + shape1F, n.int + shape2F - k.int) and Beta(k.int + shape1E, n.int + shape2E - k.int), respectively. Efficacy is declared if the posterior probability P(true response rate > pE) is >= cE. Futility is declared if the posterior probability P(true success rate > pF) is < cF. cF, cE translate into futility/efficacy boundaries (maximum number of responses leading to early termination for futility/ minimum number of responses leading to declaring of, or early termination for, efficacy).
Given the results of the interim analysis, the predictive power at the final analysis (n patients, critical number of successes k.crit) is P(X >= k.crit - k.int), where X follows a beta-binomial distribution with parameters n'= n - n.int, a = k.int + shape1, and b = n.int - k.int + shape2.
Efficacy is declared if the predictive power is >= cE (cE must be high, e.g. 0.70). Futility is declared if the predictive power is < cF (cF must be small, e.g. 0.10). cE, cF translate into futility/efficacy boundaries (maximum number of responses leading to early termination for futility/ minimum number of responses leading to declaring of, or early termination for, efficacy).
Kopp-Schneider, A., Wiesenfarth, M., Witt, R., Edelmann, D., Witt, O. and Abel, U. (2018).
Monitoring futility and efficacy in phase II trials with Bayesian
posterior distributions - a calibration approach.
Biometrical Journal, to appear.
# Operating characteristics with calling for efficacy BDP2(n=20, interim.at = c(3,9,13,18), ptrue = 0.3, eff.stop = "call", pF=0.3, cF=0.01, pE=0.12, cE = 0.9, type="PostProb", shape1F=0.3, shape2F=0.7, shape1E=0.12, shape2E=0.88) # Operating characteristics with stopping for efficacy BDP2(n=20, interim.at = c(3,9,13,18), ptrue = 0.3, eff.stop = "stop", pF=0.3, cF=0.01, pE=0.12, cE = 0.9, type="PostProb", shape1F=0.3, shape2F=0.7, shape1E=0.12, shape2E=0.88)
# Operating characteristics with calling for efficacy BDP2(n=20, interim.at = c(3,9,13,18), ptrue = 0.3, eff.stop = "call", pF=0.3, cF=0.01, pE=0.12, cE = 0.9, type="PostProb", shape1F=0.3, shape2F=0.7, shape1E=0.12, shape2E=0.88) # Operating characteristics with stopping for efficacy BDP2(n=20, interim.at = c(3,9,13,18), ptrue = 0.3, eff.stop = "stop", pF=0.3, cF=0.01, pE=0.12, cE = 0.9, type="PostProb", shape1F=0.3, shape2F=0.7, shape1E=0.12, shape2E=0.88)
NOTE: Usually function BDP2
will be preferred.
Determines the operating characteristics of a single-arm trial with a binary endpoint (success - failure) and interim futility analyses. The user can choose among 10 futility criteria, which are based on predictive or conditional power (the latter either assuming H1 or the MLE), posterior or predictive probabilities, tail probabilites (under H0 or H1), constant success rates, or arbitrary user-defined futility bounds.
Assumptions: Endpoint (success/no success) data available for all study patients. In case of Bayesian analysis: Beta-binomial model. Prior distribution = Beta(shape1,shape2) (uniform if prior.mean=0.5,prior.sampleSize=2) In case of predictive or conditional power, tail probabilities, or rates: One-sided testing in the final analysis.
BDP2_simulate(n, vn.int, p, p0, p1, alpha = 0.05, crit, type = 5, nsim, shape1 = 1, shape2 = 1)
BDP2_simulate(n, vn.int, p, p0, p1, alpha = 0.05, crit, type = 5, nsim, shape1 = 1, shape2 = 1)
n |
sample size at the final analysis |
vn.int |
vector of sample sizes at the interim analyses (the vector may be equal to 1:(n-1) = continuous monitoring of futility) |
p |
true (assumed) success rate used for simulating the trial |
p0 |
success rate corresponding to H0 |
p1 |
success rate corresponding to H1 (p1 > p0) |
alpha |
nominal probability of type 1 error used for the final test |
crit |
critical level(s) of predictive/conditional power, (posterior) probabilities, rates, or patient numbers used for early termination. crit translates into futility boundaries (maximum number of successes leading to early termination). If simple rates are used for monitoring futility (type=7), crit is the critical success rate. Rates or probabilites must be input as percentages (???). In case of type 10 analyses, crit must be a vector of numbers of successes indicating futility bounds at each (interim or final)analysis. |
type |
type of futility analysis: 1=predictive power; 2=conditional power under H1; 3=conditional power under the MLE; 4=posterior probability of a success rate > p0; 5=posterior probability of a success rate >= p1; 6=predictive probability of reaching a "positive" final study result, where "positive" is defined in terms of the posterior probability of a success rate > p0. (Here, the ciritcal level must be >= 1- alpha). 7=estimated success rate; 8=p-values; 9="p-values under H1"; 10=user- defined bounds (a vector of critical numbers of successes for each analysis) |
nsim |
number of simulation runs |
shape1 |
shape parameter for prior distribution |
shape2 |
shape parameter for prior distribution |
Some methodological details on the 10 types of futility criteria:
Type 1: Predictive power. Given the results of the interim analysis the predictive power at the final analysis (n patients, critical number of successes k.crit) is P(X >= k.crit - k.int), where X follows a beta-binomial distribution with parameters n'= n - n.int, a = k.int + shape1, and b= n.int - k.int + shape2.
Type 2,3: Conditional power. The conditional power at the interim analysis is P(X >= k.crit - k.int), where X follows a binomial distribution with parameters n'= n - n.int, and success probability either equal to p1 (futility analysis type 2) or to the estimated success rate (MLE) at the interim analysis (type 3.)
Type 4,5:Posterior probabilities. The posterior distribution at interim analysis with n.int patients and k.int successes is Beta(k.int + shape1, n + shape2 - k.int) Type 4: Futility is declared if the posterior probability P(true success rate > p0) is < crit. (Here, crit must be large,e.g. 70%). Type 5: Futility is declared if the posterior probability P(true success rate >= p1) is < crit. (Here, crit must be small, e.g. 10%).
Type 6: Predictive probability combined with posterior probability. Futility is declared if the posterior predictive probability that the study will be a success is < crit (e.g. 10%). Here, the success is defined by the total number of successes in the trial yielding a posterior probability of at least 1 - alpha (when evaluated in the final analysis) that the true success rate is > p0.
Type 7: Estimated success rates. Futility is declared if the success rate is smaller than a fixed benchmark crit. The final analysis is test-based.
Type 8,9: Tail probabilites under H0,H1. Type 8: The futility criterion uses an alpha level crit that is constant across all interim analysis. The final analysis is test-based. Futility is declared if the p-value (upper tail) is >= crit. Type 8 futility analyses should only be used if the number of patients at the first interim analysis is not too low (say, at least 5 to 10). The value of crit is not identicalt o the alpha level used in the final test. Generally, a fairly high value of crit will be appropriate (e.g. 70%). Type 9: Similar to type 8, but with lower-tail probabilites calculated under H1 ("p-values under H1"). I.e., futility is declared if, under H1, the probability of obtaining at most as many successes as the observed number is < crit ("observed number of successes "too low" to be compatible with H1 at one-sided significance level = crit). Generally, a small value of crit (e.g. 5% or 10%) should be chosen.
Type 10: User-defined boundaries. Here, the futility boundaries (maximum numbers of successes leading to early termination) are directly input by the user. crit ist the vector of these boundaries at each (interim or final) analysis. The study is terminated if the number of successes is at analysis no. m is <= the crit[m].
BDP2_simulate(n=30, vn.int=c(10,20), p=0.2, p0=0.1, p1=0.3, crit=0.1, type=5, nsim=1000,shape1=1,shape2=1)
BDP2_simulate(n=30, vn.int=c(10,20), p=0.2, p0=0.1, p1=0.3, crit=0.1, type=5, nsim=1000,shape1=1,shape2=1)
Starts a shiny app in the web browser. It provides a workflow to choose design parameters single-arm trial with a binary endpoint (response, success) and interim efficacy and futility analyses as well as routines to determine and visualize operating characteristics. Also Word/pdf/html reports can be generated.
BDP2workflow(display.mode = "normal")
BDP2workflow(display.mode = "normal")
display.mode |
display.mode passed to |
Kopp-Schneider, A., Wiesenfarth, M., Witt, R., Edelmann, D., Witt, O. and Abel, U. (2018).
Monitoring futility and efficacy in phase II trials with Bayesian
posterior distributions - a calibration approach.
Biometrical Journal, to appear.
## Not run: # Starts Shiny app BDP2workflow() ## End(Not run)
## Not run: # Starts Shiny app BDP2workflow() ## End(Not run)
Calculates CritBoundaries for different types of futility criteria
crit_general(n, p0, p1, vn.int, alpha, crit, type=5, shape1 = 1, shape2 = 1)
crit_general(n, p0, p1, vn.int, alpha, crit, type=5, shape1 = 1, shape2 = 1)
n |
sample size at the final analysis |
p0 |
success rate corresponding to H0 |
p1 |
success rate corresponding to H1 (p1 > p0) |
vn.int |
vector of sample sizes at the interim analyses (the vector may be equal to 1:(n-1) = continuous monitoring of futility) |
alpha |
nominal probability of type 1 error used for the final test |
crit |
critical level(s) of predictive/conditional power, (posterior) probabilities, rates, or patient numbers used for early termination. crit translates into futility boundaries (maximum number of successes leading to early termination). If simple rates are used for monitoring futility (type=7), crit is the critical success rate. Rates or probabilites must be input as percentages. In case of type 10 analyses, crit must be a vector of numbers of successes indicating futility bounds at each (interim or final)analysis. |
type |
see |
shape1 |
for prior distribution |
shape2 |
for prior distribution |
Determines the operating characteristics of a single-arm trial with a binary endpoint (success - failure) on the basis of analytical derivations. The design allows for futility stopping. Outputs are
probability of futility stopping (P.futil) at each interim analysis
cumulative stopping probability up to the interim (P.futil.cum).
pFstop(p, vn.int, v.crit)
pFstop(p, vn.int, v.crit)
p |
true response rate |
vn.int |
vector of sample sizes at the interim analyses |
v.crit |
vector of critical boundaries for futility stopping at the interim analyses (stop for futility if number of successes <= boundary). Choose boundary=-1 if no stopping is allowed. |
pFstop(p=0.3,vn.int=c(3,9,13,18,20),v.crit=c(0,1,2,3,3))
pFstop(p=0.3,vn.int=c(3,9,13,18,20),v.crit=c(0,1,2,3,3))
Determines the operating characteristics of a single-arm trial with a binary endpoint (success - failure) on the basis of analytical derivations. The design allows for futility stopping and evaluates efficacy at interim. Outputs are
probability of calling efficacy (P.effic) at each interim analysis
cumulative probability of calling efficacy up to the interim (P.effic.cum).
probability of futility stopping (P.futil) at each interim analysis
cumulative stopping probability up to the interim (P.futil.cum).
pFstopEcall(p, vn.int, v.critE, v.critF)
pFstopEcall(p, vn.int, v.critE, v.critF)
p |
true response rate |
vn.int |
vector of sample sizes at the interim analyses |
v.critE |
vector of critical boundaries for calling efficacy at the interim analyses (call efficacy if number of successes >= boundary) |
v.critF |
vector of critical boundaries for futility stopping at the interim analyses (stop for futility if number of successes <= boundary). Choose boundary=-1 if no stopping for futility is allowed. |
pFstopEcall(p=0.3,vn.int=c(3,9,13,18,20),v.critE=4:8, v.critF=c(0,1,2,3,3))
pFstopEcall(p=0.3,vn.int=c(3,9,13,18,20),v.critE=4:8, v.critF=c(0,1,2,3,3))
Determines the operating characteristics of a single-arm trial with a binary endpoint (success - failure) on the basis of analytical derivations. The design allows for stopping for futility and stopping for efficacy. Outputs are
probability of stopping for efficacy (P.effic) at each interim analysis
cumulative probability of stopping for efficacy up to the interim (P.effic.cum).
probability of futility stopping (P.futil) at each interim analysis
cumulative stopping probability up to the interim (P.futil.cum).
pFstopEstop(p, vn.int, v.critE, v.critF)
pFstopEstop(p, vn.int, v.critE, v.critF)
p |
true response rate |
vn.int |
vector of sample sizes at the interim analyses |
v.critE |
vector of critical boundaries for calling efficacy at the interim analyses (stop for efficacy if number of successes >= boundary) |
v.critF |
vector of critical boundaries for futility stopping at the interim analyses (stop for futility if number of successes <= boundary). Choose boundary=-1 if no stopping for futility is allowed. |
pFstopEstop(p=0.3,vn.int=c(3,9,13,18,20),v.critE=4:8, v.critF=c(0,1,2,3,3))
pFstopEstop(p=0.3,vn.int=c(3,9,13,18,20),v.critE=4:8, v.critF=c(0,1,2,3,3))
Plot objects returned by plotBDP2
with arguments x="cE"
and either y="PEcall"
or y="PEstop"
which can computationally be relatively expensive.
## S3 method for class 'cE_vs_pEcall' plot(x, ...) ## S3 method for class 'cE_vs_pEstop' plot(x, ...)
## S3 method for class 'cE_vs_pEcall' plot(x, ...) ## S3 method for class 'cE_vs_pEstop' plot(x, ...)
x |
Object returned by |
... |
arguments passed to |
shape1F=0.3 shape2F=0.7 shape1E=0.12 shape2E=0.88 res=plotBDP2(x="cE",y="PEcall",n=30,interim.at=15, pF=0.3,cF=0.01,pE=0.12,cE=seq(.5,1,by=.01),p0=0.3,p1=0.12, shape1F=shape1F,shape2F=shape2F,shape1E=shape1E,shape2E=shape2E, col=c("green","red"),cex.sub=.8) plot(res)
shape1F=0.3 shape2F=0.7 shape1E=0.12 shape2E=0.88 res=plotBDP2(x="cE",y="PEcall",n=30,interim.at=15, pF=0.3,cF=0.01,pE=0.12,cE=seq(.5,1,by=.01),p0=0.3,p1=0.12, shape1F=shape1F,shape2F=shape2F,shape1E=shape1E,shape2E=shape2E, col=c("green","red"),cex.sub=.8) plot(res)
Output of desired plots
plotBDP2(x = c("n", "k", "ptrue", "cE", "cF"), y = c("Prob0Successes", "PostProb0or1Successes", "bFbE", "PEcall_p0_p1", "PEstop_p0_p1", "PFstopEcall", "PFstopEstop", "PEcall", "PEstop", "PFstop", "PFstopEstop", "ExpectedNumber", "PredictivePower"), n, interim.at, ptrue, pF, cF, pE, cE, p0, p1, Estop=FALSE, shape1F, shape2F, shape1E = NULL, shape2E = NULL, col = c("green", "red"), cex.legend=1, add = FALSE, show=TRUE, progress = FALSE, ...)
plotBDP2(x = c("n", "k", "ptrue", "cE", "cF"), y = c("Prob0Successes", "PostProb0or1Successes", "bFbE", "PEcall_p0_p1", "PEstop_p0_p1", "PFstopEcall", "PFstopEstop", "PEcall", "PEstop", "PFstop", "PFstopEstop", "ExpectedNumber", "PredictivePower"), n, interim.at, ptrue, pF, cF, pE, cE, p0, p1, Estop=FALSE, shape1F, shape2F, shape1E = NULL, shape2E = NULL, col = c("green", "red"), cex.legend=1, add = FALSE, show=TRUE, progress = FALSE, ...)
x |
character string specifying what is given by the x axis
|
y |
character string specifying what is given by the y axis
|
n |
sample size at the final analysis, vector if |
interim.at |
vector of sample sizes at the interim analyses |
ptrue |
true (assumed) response rate used for simulating the trial, vector if |
pF |
response rate used for the futility criterion P(p>pF|Data) < cF (may be identical to pE) |
cF |
critical level of posterior probabilities used for declaring futility, vector if |
pE |
response rate used for the efficacy criterion P(p>pE|Data) >= cE |
cE |
critical level of posterior probabilities used for declaring efficacy, vector if |
p0 |
response rate corresponding to H0 |
p1 |
response rate corresponding to H1 (p1 > p0) |
shape1F |
first parameter of the Beta prior for futility analysis |
shape2F |
second parameter of the Beta prior for futility analysis |
shape1E |
first parameter of the Beta prior for efficacy analysis |
shape2E |
second parameter of the Beta prior for efficacy analysis |
Estop |
Stop for efficacy? Defaults to |
col |
line color, for some plots vector of length 2. |
add |
add line to existing plot. Only supported if |
show |
show plot (otherwise computed objects are invisibly returned) |
progress |
only used by shiny app |
cex.legend |
size of legend text relative to cex |
... |
additional arguments passed to |
Kopp-Schneider, A., Wiesenfarth, M., Witt, R., Edelmann, D., Witt, O. and Abel, U. (2018).
Monitoring futility and efficacy in phase II trials with Bayesian
posterior distributions - a calibration approach.
Biometrical Journal, to appear.
# See vignette for more details and examples pF=0.3 pE=0.12 shape1F=0.3 shape2F=0.7 shape1E=0.12 shape2E=0.88 cF=0.01 cE=0.9 nvec=c(18:40) interim.at=c(10,20,30) # Type I error and probability of true stopping for the uninteresting response rate. ptrue=0.12 plotBDP2(x="n", y="PFstopEcall", n =nvec, interim.at = interim.at, pF=pF,cF=cF,pE=pE,cE=cE,ptrue=ptrue, shape1F=shape1F,shape2F=shape2F,shape1E=shape1E,shape2E=shape2E) # Power and probability of false stopping for the target response rate. ptrue=0.3 plotBDP2(x="n", y="PFstopEcall", n =nvec, interim.at = interim.at, pF=pF,cF=cF,pE=pE,cE=cE,ptrue=ptrue, shape1F=shape1F,shape2F=shape2F,shape1E=shape1E,shape2E=shape2E)
# See vignette for more details and examples pF=0.3 pE=0.12 shape1F=0.3 shape2F=0.7 shape1E=0.12 shape2E=0.88 cF=0.01 cE=0.9 nvec=c(18:40) interim.at=c(10,20,30) # Type I error and probability of true stopping for the uninteresting response rate. ptrue=0.12 plotBDP2(x="n", y="PFstopEcall", n =nvec, interim.at = interim.at, pF=pF,cF=cF,pE=pE,cE=cE,ptrue=ptrue, shape1F=shape1F,shape2F=shape2F,shape1E=shape1E,shape2E=shape2E) # Power and probability of false stopping for the target response rate. ptrue=0.3 plotBDP2(x="n", y="PFstopEcall", n =nvec, interim.at = interim.at, pF=pF,cF=cF,pE=pE,cE=cE,ptrue=ptrue, shape1F=shape1F,shape2F=shape2F,shape1E=shape1E,shape2E=shape2E)