| Title: | Bayesian Optimal Phase II Design with Futility and Efficacy Stopping Boundaries |
|---|---|
| Description: | Bayesian optimal design with futility and efficacy stopping boundaries (BOP2-FE) is a novel statistical framework for single-arm Phase II clinical trials. It enables early termination for efficacy when interim data are promising, while explicitly controlling Type I and Type II error rates. The design supports a variety of endpoint structures, including single binary endpoints, nested endpoints, co-primary endpoints, and joint monitoring of efficacy and toxicity. The package provides tools for enumerating stopping boundaries prior to trial initiation and for conducting simulation studies to evaluate the design’s operating characteristics. Users can flexibly specify design parameters to suit their specific applications. For methodological details, refer to Xu et al. (2025) <doi:10.1080/10543406.2025.2558142>. |
| Authors: | Belay Birlie Yimer [aut, cre], Xinling Xu [aut], Atsuki Hashimoto [aut], Gosuke Homma [aut], Kentaro Takeda [aut] |
| Maintainer: | Belay Birlie Yimer <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.3 |
| Built: | 2026-05-13 09:43:50 UTC |
| Source: | https://github.com/belayb/bop2fe |
Computes stopping boundaries and operating characteristics of Bayesian optimal phase II design with efficacy and futility stopping for a binary endpoint
BOP2FE_binary( H0, H1, n, nsim, t1e = NULL, method = "power", lambda1, lambda2, grid1, gamma1, gamma2, grid2, eta1 = NULL, eta2 = NULL, grid3 = NULL, seed = NULL )BOP2FE_binary( H0, H1, n, nsim, t1e = NULL, method = "power", lambda1, lambda2, grid1, gamma1, gamma2, grid2, eta1 = NULL, eta2 = NULL, grid3 = NULL, seed = NULL )
H0 |
A numeric value for the response rate under the null hypothesis. |
H1 |
A numeric value for the response rate under the alternative hypothesis. |
n |
A numeric vector representing the additional patients enrolled at each interim analysis. The value at index 'i' indicates the number of new patients added at interim analysis 'i'. The total sample size at interim 'i' is the cumulative sum of the values in 'n' up to that index. For example, for four interim analyses with total sample sizes of 10, 15, 20, and 30, the vector would be represented as 'n = c(10, 5, 5, 10)', where: - 10 is the number of patients enrolled at interim 1, - 5 (15 - 10) is the additional number of patients enrolled at interim 2, - 5 (20 - 15) is the additional number of patients enrolled at interim 3, - 10 (30 - 20) is the additional number of patients enrolled at interim 4. |
nsim |
number of simulation. A value at least 1000 for better result. |
t1e |
Desired Type - I error rate. If specified it will only return results with type I error rate less the specified value |
method |
A character string specifying the method to use for calculating cutoff values for the efficacy stopping. Options are "power" (default) or "OF" for "O'Brien-Fleming". |
lambda1 |
starting value for 'lambda' values to search. |
lambda2 |
ending value for 'lambda' values to search. |
grid1 |
number of 'lambda' values to consider between lambda1 and lambda2. A fine grid by 0.01 is recommended. |
gamma1 |
starting value for 'gamma' values to search. |
gamma2 |
ending value for 'gamma' values to search. |
grid2 |
number of 'gamma' values to consider between gamma1 and gamma2. A fine grid by 0.01 is recommended. |
eta1 |
starting value for 'eta' values to search. |
eta2 |
ending value for 'eta' values to search. |
grid3 |
number of eta values to consider between eta1 and eta2. A fine grid by 0.01 is recommended. |
seed |
for reproducibility |
An S3 object of class 'bop2fe'
Xu, X., Hashimoto, A., Yimer, B., & Takeda, K. (2025). BOP2-FE: Bayesian optimal phase II design with futility and efficacy stopping boundaries. Journal of Biopharmaceutical Statistics doi:10.1080/10543406.2025.2558142.
test_binary <- BOP2FE_binary( H0=0.2, H1= 0.4, n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31,seed = 123) summary(test_binary) #plot(test_binary)test_binary <- BOP2FE_binary( H0=0.2, H1= 0.4, n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31,seed = 123) summary(test_binary) #plot(test_binary)
Computes stopping boundaries and operating characteristics of Bayesian optimal phase II design with efficacy and futility stopping for a co-primary endpoint.
BOP2FE_coprimary( H0, H1, n, nsim, t1e = NULL, method = "power", lambda1, lambda2, grid1, gamma1, gamma2, grid2, eta1 = NULL, eta2 = NULL, grid3 = NULL, seed = NULL )BOP2FE_coprimary( H0, H1, n, nsim, t1e = NULL, method = "power", lambda1, lambda2, grid1, gamma1, gamma2, grid2, eta1 = NULL, eta2 = NULL, grid3 = NULL, seed = NULL )
H0 |
A numeric vector representing the null response rates for different outcomes, specified in the following order: - 'H0[1]': Response - PFS6, - 'H0[2]': Response - no PFS6, - 'H0[3]': No Response - PFS6, - 'H0[4]': No Response - no PFS6 |
H1 |
A numeric vector representing the null response rates for different outcomes, specified in the following order: - 'H1[1]': Response - PFS6, - 'H1[2]': Response - no PFS6, - 'H1[3]': No Response - PFS6, - 'H1[4]': No Response - no PFS6 |
n |
A numeric vector representing the additional patients enrolled at each interim analysis. The value at index 'i' indicates the number of new patients added at interim analysis 'i'. The total sample size at interim 'i' is the cumulative sum of the values in 'n' up to that index. For example, for four interim analyses with total sample sizes of 10, 15, 20, and 30, the vector would be represented as 'n = c(10, 5, 5, 10)', where: - 10 is the number of patients enrolled at interim 1, - 5 (15 - 10) is the additional number of patients enrolled at interim 2, - 5 (20 - 15) is the additional number of patients enrolled at interim 3, - 10 (30 - 20) is the additional number of patients enrolled at interim 4. |
nsim |
number of simulation. A value at least 1000 for better result. |
t1e |
Desired Type - I error rate. If specified it will only return results with type I error rate less the specified value |
method |
A character string specifying the method to use for calculating cutoff values for the efficacy stopping. Options are "power" (default) or "OF" for "O'Brien-Fleming". |
lambda1 |
starting value for 'lambda' values to search. |
lambda2 |
ending value for 'lambda' values to search. |
grid1 |
number of 'lambda' values to consider between lambda1 and lambda2. A fine grid by 0.01 is recommended. |
gamma1 |
starting value for 'gamma' values to search. |
gamma2 |
ending value for 'gamma' values to search. |
grid2 |
number of 'gamma' values to consider between gamma1 and gamma2. A fine grid by 0.01 is recommended. |
eta1 |
starting value for 'eta' values to search. |
eta2 |
ending value for 'eta' values to search. |
grid3 |
number of eta values to consider between eta1 and eta2. A fine grid by 0.01 is recommended. |
seed |
for reproducibility |
An S3 object of class 'bop2fe'
Xu, X., Hashimoto, A., Yimer, B., & Takeda, K. (2025). BOP2-FE: Bayesian optimal phase II design with futility and efficacy stopping boundaries. Journal of Biopharmaceutical Statistics doi:10.1080/10543406.2025.2558142.
test_coprimary <- BOP2FE_coprimary( H0=c(0.05,0.05, 0.15, 0.75), H1= c(0.15,0.15, 0.20, 0.50), n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31, seed = 123) summary(test_coprimary) #plot(test_coprimary)test_coprimary <- BOP2FE_coprimary( H0=c(0.05,0.05, 0.15, 0.75), H1= c(0.15,0.15, 0.20, 0.50), n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31, seed = 123) summary(test_coprimary) #plot(test_coprimary)
Computes stopping boundaries and operating characteristics of Bayesian optimal phase II design with efficacy and futility stopping for a joint efficacy and toxicity endpoint.
BOP2FE_jointefftox( H0, H1, n, nsim, t1e = NULL, method = "power", lambda1, lambda2, grid1, gamma1, gamma2, grid2, eta1 = NULL, eta2 = NULL, grid3 = NULL, seed = NULL )BOP2FE_jointefftox( H0, H1, n, nsim, t1e = NULL, method = "power", lambda1, lambda2, grid1, gamma1, gamma2, grid2, eta1 = NULL, eta2 = NULL, grid3 = NULL, seed = NULL )
H0 |
A numeric vector representing the null response rates for different outcomes, specified in the following order: - 'H0[1]': Response - toxicity, - 'H0[2]': Response - no toxicity, - 'H0[3]': No Response - toxicity, - 'H0[4]': No Response - no toxicity |
H1 |
A numeric vector representing the null response rates for different outcomes, specified in the following order: - 'H1[1]': Response - toxicity, - 'H1[2]': Response - no toxicity, - 'H1[3]': No Response - toxicity, - 'H1[4]': No Response - no toxicity. |
n |
A numeric vector representing the additional patients enrolled at each interim analysis. The value at index 'i' indicates the number of new patients added at interim analysis 'i'. The total sample size at interim 'i' is the cumulative sum of the values in 'n' up to that index. For example, for four interim analyses with total sample sizes of 10, 15, 20, and 30, the vector would be represented as 'n = c(10, 5, 5, 10)', where: - 10 is the number of patients enrolled at interim 1, - 5 (15 - 10) is the additional number of patients enrolled at interim 2, - 5 (20 - 15) is the additional number of patients enrolled at interim 3, - 10 (30 - 20) is the additional number of patients enrolled at interim 4. |
nsim |
number of simulation. A value at least 1000 for better result. |
t1e |
Desired Type - I error rate. If specified it will only return results with type I error rate less the specified value |
method |
A character string specifying the method to use for calculating cutoff values for the efficacy stopping. Options are "power" (default) or "OF" for "O'Brien-Fleming". |
lambda1 |
starting value for 'lambda' values to search. |
lambda2 |
ending value for 'lambda' values to search. |
grid1 |
number of 'lambda' values to consider between lambda1 and lambda2. A fine grid by 0.01 is recommended. |
gamma1 |
starting value for 'gamma' values to search. |
gamma2 |
ending value for 'gamma' values to search. |
grid2 |
number of 'gamma' values to consider between gamma1 and gamma2. A fine grid by 0.01 is recommended. |
eta1 |
starting value for 'eta' values to search. |
eta2 |
ending value for 'eta' values to search. |
grid3 |
number of eta values to consider between eta1 and eta2. A fine grid by 0.01 is recommended. |
seed |
for reproducibility |
An S3 object of class 'bop2fe'
Xu, X., Hashimoto, A., Yimer, B., & Takeda, K. (2025). BOP2-FE: Bayesian optimal phase II design with futility and efficacy stopping boundaries. Journal of Biopharmaceutical Statistics doi:10.1080/10543406.2025.2558142 .
test_joint <- BOP2FE_jointefftox( H0=c(0.15,0.30, 0.15, 0.40), H1= c(0.18,0.42, 0.02, 0.38), n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31, seed = 123 ) summary(test_joint) #plot(test_joint)test_joint <- BOP2FE_jointefftox( H0=c(0.15,0.30, 0.15, 0.40), H1= c(0.18,0.42, 0.02, 0.38), n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31, seed = 123 ) summary(test_joint) #plot(test_joint)
Computes stopping boundaries and operating characteristics of Bayesian optimal phase II design with efficacy and futility stopping for a nested (ordinal) endpoint
BOP2FE_nested( H0, H1, n, nsim, t1e = NULL, method = "power", lambda1, lambda2, grid1, gamma1, gamma2, grid2, eta1 = NULL, eta2 = NULL, grid3 = NULL, seed = NULL )BOP2FE_nested( H0, H1, n, nsim, t1e = NULL, method = "power", lambda1, lambda2, grid1, gamma1, gamma2, grid2, eta1 = NULL, eta2 = NULL, grid3 = NULL, seed = NULL )
H0 |
A numeric vector representing the null response rates for different outcomes, specified in the following order: - 'H0[1]': CR: Complete remission, - 'H0[2]': PR: Partial remission, - 'H0[3]': 1-(CR+PR) |
H1 |
A numeric vector representing the null response rates for different outcomes, specified in the following order: - 'H1[1]': CR: Complete remission, - 'H1[2]': PR: Partial remission, - 'H1[3]': 1-(CR+PR) |
n |
A numeric vector representing the additional patients enrolled at each interim analysis. The value at index 'i' indicates the number of new patients added at interim analysis 'i'. The total sample size at interim 'i' is the cumulative sum of the values in 'n' up to that index. For example, for four interim analyses with total sample sizes of 10, 15, 20, and 30, the vector would be represented as 'n = c(10, 5, 5, 10)', where: - 10 is the number of patients enrolled at interim 1, - 5 (15 - 10) is the additional number of patients enrolled at interim 2, - 5 (20 - 15) is the additional number of patients enrolled at interim 3, - 10 (30 - 20) is the additional number of patients enrolled at interim 4. |
nsim |
number of simulation. A value at least 1000 for better result. |
t1e |
Desired Type - I error rate. If specified it will only return results with type I error rate less the specified value |
method |
A character string specifying the method to use for calculating cutoff values for the efficacy stopping. Options are "power" (default) or "OF" for "O'Brien-Fleming". |
lambda1 |
starting value for 'lambda' values to search. |
lambda2 |
ending value for 'lambda' values to search. |
grid1 |
number of 'lambda' values to consider between lambda1 and lambda2. A fine grid by 0.01 is recommended. |
gamma1 |
starting value for 'gamma' values to search. |
gamma2 |
ending value for 'gamma' values to search. |
grid2 |
number of 'gamma' values to consider between gamma1 and gamma2. A fine grid by 0.01 is recommended. |
eta1 |
starting value for 'eta' values to search. |
eta2 |
ending value for 'eta' values to search. |
grid3 |
number of eta values to consider between eta1 and eta2. A fine grid by 0.01 is recommended. |
seed |
for reproducibility |
An S3 object of class 'bop2fe'
Xu, X., Hashimoto, A., Yimer, B., & Takeda, K. (2025). BOP2-FE: Bayesian optimal phase II design with futility and efficacy stopping boundaries. Journal of Biopharmaceutical Statistics doi:10.1080/10543406.2025.2558142.
test_nested <- BOP2FE_nested( H0=c(0.15,0.15, 0.70), H1= c(0.25,0.25, 0.50), n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31, seed = 123) summary(test_nested) #plot(test_nested)test_nested <- BOP2FE_nested( H0=c(0.15,0.15, 0.70), H1= c(0.25,0.25, 0.50), n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31, seed = 123) summary(test_nested) #plot(test_nested)
Boundary values for binary Endpoint
get_boundary_binary( H0, a1, b1, n, lambda, gamma, eta = NULL, method = "power", seed = NULL )get_boundary_binary( H0, a1, b1, n, lambda, gamma, eta = NULL, method = "power", seed = NULL )
H0 |
Response rate under the null |
a1 |
alpha values for the beta prior (i.e. usually set to the null response rate) |
b1 |
beta values for the beta prior (i.e. usually set to 1 - the null response rate) |
n |
A numeric vector representing the additional patients enrolled at each interim analysis.
The value at index
|
lambda |
A vector of values for parameter 'lambda' of the cut-off probability (i.e common for both efficacy and futility cut-off probability) |
gamma |
A vector of values for parameter 'gamma' of the cut-off probability for futility |
eta |
A vector of values for parameter 'eta' of the cut-off probability for efficacy |
method |
type of function to be used for the cut off probability for superiority. The default is "power" type function. method=OF is an alternative for "O'Brien-Fleming" |
seed |
seed number |
A list with the first element corresponding to futility and the second for efficacy boundaries
H0 <- 0.2 a1 <- H0 b1 <- 1- a1 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_binary<- get_boundary_binary(H0=H0, a1=a1, b1=b1, n =n, lambda = seq(0, 1, l = 101), gamma = seq(0, 1, l = 101), eta = seq(0, 3, l = 301), method = method, seed = seed)H0 <- 0.2 a1 <- H0 b1 <- 1- a1 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_binary<- get_boundary_binary(H0=H0, a1=a1, b1=b1, n =n, lambda = seq(0, 1, l = 101), gamma = seq(0, 1, l = 101), eta = seq(0, 3, l = 301), method = method, seed = seed)
Boundary values for co-primary Endpoint
get_boundary_coprimary( H0, a, n, lambda, gamma, eta = NULL, method = "power", seed = NULL )get_boundary_coprimary( H0, a, n, lambda, gamma, eta = NULL, method = "power", seed = NULL )
H0 |
Response rate under the null (Response - PFS6, Response - no PFS6, No response - PFS6, No response - No PFS6) |
a |
alpha values for the beta prior (i.e. usually set to the null response rate) |
n |
A numeric vector representing the additional patients enrolled at each interim analysis.
The value at index
|
lambda |
A vector of values for parameter 'lambda' of the cut-off probability (i.e common for both efficacy and futility cut-off probability) |
gamma |
A vector of values for parameter 'gamma' of the cut-off probability for futility |
eta |
A vector of values for parameter 'eta' of the cut-off probability for efficacy |
method |
type of function to be used for the cut off probability for superiority. The default is "power" type function. method=OF is an alternative for "O'Brien-Fleming" |
seed |
seed number |
A list with the first element corresponding to futility and the second for efficacy boundaries
H0=c(0.05,0.05, 0.15, 0.75) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" test1<- get_boundary_coprimary(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = "power")H0=c(0.05,0.05, 0.15, 0.75) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" test1<- get_boundary_coprimary(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = "power")
Boundary values for joint Endpoint
get_boundary_jointefftox( H0, a, n, lambda, gamma, eta = NULL, method = "power", seed = NULL )get_boundary_jointefftox( H0, a, n, lambda, gamma, eta = NULL, method = "power", seed = NULL )
H0 |
Response rate under the null (toxicity - OR, no toxicity - OR, toxicity - no OR, no toxicity - No OR) |
a |
alpha values for the beta prior (i.e. usually set to the null response rate) |
n |
A numeric vector representing the additional patients enrolled at each interim analysis.
The value at index
|
lambda |
A vector of values for parameter 'lambda' of the cut-off probability (i.e common for both efficacy and futility cut-off probability) |
gamma |
A vector of values for parameter 'gamma' of the cut-off probability for futility |
eta |
A vector of values for parameter 'eta' of the cut-off probability for efficacy |
method |
type of function to be used for the cut off probability for superiority. The default is "power" type function. method=OF is an alternative for "O'Brien-Fleming" |
seed |
seed number |
A list with the first element corresponding to futility and the second for efficacy boundaries
H0=c(0.15,0.30, 0.15, 0.40) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" test1<- get_boundary_jointefftox(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = "power")H0=c(0.15,0.30, 0.15, 0.40) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" test1<- get_boundary_jointefftox(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = "power")
Boundary values for Nested Endpoint
get_boundary_nested( H0, a, n, lambda, gamma, eta = NULL, method = "power", seed = NULL )get_boundary_nested( H0, a, n, lambda, gamma, eta = NULL, method = "power", seed = NULL )
H0 |
Response rate under the null , specified in the following order: - 'H0[1]': Complete Remission (CR) rate, - 'H0[2]': Partial Remission (PR) rate, - 'H0[3]': No Complete Remission or Partial Remission rate, calculated as '1 - (CR + PR)'. |
a |
alpha values for the beta prior (i.e. usually set to the null response rate) |
n |
A numeric vector representing the additional patients enrolled at each interim analysis.
The value at index
|
lambda |
A vector of values for parameter 'lambda' of the cut-off probability (i.e common for both efficacy and futility cut-off probability) |
gamma |
A vector of values for parameter 'gamma' of the cut-off probability for futility |
eta |
A vector of values for parameter 'eta' of the cut-off probability for efficacy |
method |
type of function to be used for the cut off probability for superiority. The default is "power" type function. method=OF is an alternative for "O'Brien-Fleming" |
seed |
seed number |
A list with the first element corresponding to futility and the second for efficacy boundaries
H0 <- c(0.15, 0.15, 0.70) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_nested<- get_boundary_nested(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = method, seed = seed)H0 <- c(0.15, 0.15, 0.70) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_nested<- get_boundary_nested(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = method, seed = seed)
Operating characteristics for binary Endpoint
get_oc_binary(p, n, nsim, fb, sb, seed = NULL)get_oc_binary(p, n, nsim, fb, sb, seed = NULL)
p |
Response rate |
n |
A numeric vector representing the additional patients enrolled at each interim analysis.
The value at index
|
nsim |
number of simulation |
fb |
vector/matrix of futility boundary at each interim analysis specified in the following order: c(f_1,..., f_length(n)) |
sb |
vector/matrix of superiority boundary at each interim analysis specified in the following order: c(s_1,..., s_length(n)) |
seed |
for reproducibility |
A data frame with the following columns
lambda values for cut-off probability
gamma values for cut-off probability
eta values for cut-off probability
Average number of early stopping due to futility
Average number of early stopping for futility due to efficacy
Average sample size
Average number of hypothesis rejection at the final analysis (aka Type-I error if the response rate is the null rate or Power if the response rate is the alternative rate.
Total number of early stopping due to futility
Total number of early early stopping due to efficacy
Sum of sample sizes across simulation
Total number of hypothesis rejection at the final analysis
H0 <- 0.2 a1 <- H0 b1 <- 1-a1 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_tab<- get_boundary_binary(H0=H0, a1=a1, b1=b1, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = method, seed=seed) test_oc<-get_oc_binary( p = 0.2, n = c(10, 5, 5), nsim = 1000, fb = boundary_tab$cnf, sb = boundary_tab$cns, seed = seed )H0 <- 0.2 a1 <- H0 b1 <- 1-a1 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_tab<- get_boundary_binary(H0=H0, a1=a1, b1=b1, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = method, seed=seed) test_oc<-get_oc_binary( p = 0.2, n = c(10, 5, 5), nsim = 1000, fb = boundary_tab$cnf, sb = boundary_tab$cns, seed = seed )
Operating characteristics for for coprimary Endpoint
get_oc_coprimary(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL)get_oc_coprimary(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL)
p1 |
Response rate (Response - PFS6) |
p2 |
Response rate (Response - no PFS6) |
p3 |
Response rate (No Response - PFS6) |
p4 |
Response rate (No Response - no PFS6) |
n |
A numeric vector representing the additional patients enrolled at each interim analysis.
The value at index
|
nsim |
number of simulation |
fb |
vector/matrix of futility boundary at each interim analysis specified in the following order: c(resp_1,..., resp_length(n), PFS6_1, ..., PFS6_length(n)) |
sb |
vector/matrix of superiority boundary at each interim analysis specified in the following order: c(resp_1,..., resp_length(n), PFS6_1, ..., PFS6_length(n)) |
seed |
for reproducibility |
A data frame with the following columns
lambda values for cut-off probability
gamma values for cut-off probability
eta values for cut-off probability
Average number of early stopping due to futility
Average number of early stopping for futility due to efficacy
Average sample size"
"Average number of hypothesis rejection at the final analysis (aka Type-I error if the response rate is the null rate or Power if the response rate is the alternative rate.
Total number of early stopping due to futility
Total number of early early stopping due to efficacy
Sum of sample sizes across simulation"
Total number of hypothesis rejection at the final analysis
H0=c(0.05,0.05, 0.15, 0.75) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_tab<- get_boundary_coprimary(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = "power", seed=seed) test_oc<-get_oc_coprimary( p1 = 0.05, p2 = 0.05, p3 = 0.15, p4 = 0.75, n = c(10, 5, 5), nsim = 1000, fb = boundary_tab$cnf, sb = boundary_tab$cns, seed = seed )H0=c(0.05,0.05, 0.15, 0.75) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_tab<- get_boundary_coprimary(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = "power", seed=seed) test_oc<-get_oc_coprimary( p1 = 0.05, p2 = 0.05, p3 = 0.15, p4 = 0.75, n = c(10, 5, 5), nsim = 1000, fb = boundary_tab$cnf, sb = boundary_tab$cns, seed = seed )
Operating characteristics for for joint Endpoint
get_oc_jointefftox(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL)get_oc_jointefftox(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL)
p1 |
Response rate (Response - toxicity) |
p2 |
Response rate (Response - no toxicity) |
p3 |
Response rate (No Response - toxicity) |
p4 |
Response rate (No Response - no toxicity) |
n |
A numeric vector representing the additional patients enrolled at each interim analysis.
The value at index
|
nsim |
number of simulation |
fb |
vector/matrix of futility boundary at each interim analysis specified in the following order: c(resp_1,..., resp_length(n), tox_1, ..., tox_length(n)) |
sb |
vector/matrix of superiority boundary at each interim analysis specified in the following order: c(resp_1,..., resp_length(n), tox_1, ..., tox_length(n)) |
seed |
for reproducibility |
A data frame with the following columns
lambda values for cut-off probability
gamma values for cut-off probability
eta values for cut-off probability
Average number of early stopping due to futility
Average number of early stopping for futility due to efficacy
Average sample size"
"Average number of hypothesis rejection at the final analysis (aka Type-I error if the response rate is the null rate or Power if the response rate is the alternative rate.
Total number of early stopping due to futility
Total number of early early stopping due to efficacy
Sum of sample sizes across simulation"
Total number of hypothesis rejection at the final analysis
H0=c(0.15,0.30, 0.15, 0.40) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_tab<- get_boundary_jointefftox(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = "power", seed=seed) test_oc<-get_oc_jointefftox( p1 = 0.15, p2 = 0.30, p3 = 0.15, p4 = 0.40, n = c(10, 5, 5), nsim = 1000, fb = boundary_tab$cnf, sb = boundary_tab$cns, seed = seed )H0=c(0.15,0.30, 0.15, 0.40) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_tab<- get_boundary_jointefftox(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = "power", seed=seed) test_oc<-get_oc_jointefftox( p1 = 0.15, p2 = 0.30, p3 = 0.15, p4 = 0.40, n = c(10, 5, 5), nsim = 1000, fb = boundary_tab$cnf, sb = boundary_tab$cns, seed = seed )
Operating characteristics for Nested Endpoint
get_oc_nested(p1, p2, p3, n, nsim, fb, sb, seed = NULL)get_oc_nested(p1, p2, p3, n, nsim, fb, sb, seed = NULL)
p1 |
Response rate (CR: Complete remission) |
p2 |
Response rate (PR: Partial remission) |
p3 |
Response rate (1-(CR+PR)) |
n |
A numeric vector representing the additional patients enrolled at each interim analysis.
The value at index
|
nsim |
number of simulation |
fb |
vector/matrix of futility boundary at each interim analysis specified in the following order: c(CR_1,..., CR_length(n), CR/PR_1, ..., CR/PR_length(n)) |
sb |
vector/matrix of superiority boundary at each interim analysis specified in the following order: c(CR_1,..., CR_length(n), CR/PR_1, ..., CR/PR_length(n)) |
seed |
for reproducibility |
A data frame with the following columns
lambda values for cut-off probability
gamma values for cut-off probability
eta values for cut-off probability
Average number of early stopping due to futility
Average number of early stopping for futility due to efficacy
Average sample size"
"Average number of hypothesis rejection at the final analysis (aka Type-I error if the response rate is the null rate or Power if the response rate is the alternative rate.
Total number of early stopping due to futility
Total number of early early stopping due to efficacy
Sum of sample sizes across simulation"
Total number of hypothesis rejection at the final analysis
H0=c(0.15, 0.15, 0.70) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_tab<- get_boundary_nested(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = method, seed=seed) test_oc<-get_oc_nested( p1 = 0.15, p2 = 0.15, p3 = 0.70, n = c(10, 5, 5), nsim = 1000, fb = boundary_tab$cnf, sb = boundary_tab$cns, seed = seed )H0=c(0.15, 0.15, 0.70) a <- H0 seed <- 123 n <- c(10, 5, 5) method <- "power" boundary_tab<- get_boundary_nested(H0=H0, a=a, n =n, lambda = seq(0, 1, l = 11), gamma = seq(0, 1, l = 11), eta = seq(0, 3, l = 31), method = method, seed=seed) test_oc<-get_oc_nested( p1 = 0.15, p2 = 0.15, p3 = 0.70, n = c(10, 5, 5), nsim = 1000, fb = boundary_tab$cnf, sb = boundary_tab$cns, seed = seed )
Plot the objects returned by other functions, including (1) cut-off probability; (2) boundary values; (3) operating characteristics
## S3 method for class 'bop2fe' plot(x, ...)## S3 method for class 'bop2fe' plot(x, ...)
x |
the object returned by BOP2FE_xx |
... |
additional parameters |
plot() returns a figure depending on the object entered
After identifying the optimal boundary that controls the Type I error rate less than or equal to 0.1 under H0 and maximize the power under H1, it might be of interest to compute the operating characteristics of the optimal boundary under a different H1 values. This function accepts a single or multiple values of additional H1 values and compute the operating characteristics for each of them.
simulate_oc(object, p, endpoint, seed = NULL)simulate_oc(object, p, endpoint, seed = NULL)
object |
the object returned by BOP2FE_xx |
p |
a single vector or a list of vector for which the operating characteristics is desired. |
endpoint |
the type of endpoint. Possible options are 'binary', 'nested', 'coprimary', and 'joint'. |
seed |
for reproducibility |
simulate_oc() returns a data frame with the optimal pars and boundary from the given object as well
as the operating characteristics. If a single p vector is supplied the result will be a data frame
with a single row. If multiple p vectors are supplied the data frame will be have multiple rows each
corresponding to the p vectors in the order of their specification
test_nested <- BOP2FE_nested( H0=c(0.15,0.15, 0.70), H1= c(0.25,0.25, 0.50), n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31, seed = 123 ) # Compute operating characteristics for a single p vector simulate_oc(test_nested, p=c(0.30,0.30,0.40), endpoint = 'nested', seed=123) # Compute operating characteristics for multiple p vector simulate_oc(test_nested, p=list(c(0.30,0.30,0.40),c(0.35,0.35,0.30)), endpoint = 'nested', seed=123)test_nested <- BOP2FE_nested( H0=c(0.15,0.15, 0.70), H1= c(0.25,0.25, 0.50), n = c(10, 5, 5), nsim = 1000, t1e = 0.1, method = "power", lambda1 = 0, lambda2 = 1, grid1 = 11, gamma1 = 0, gamma2 = 1, grid2 = 11, eta1 = 0, eta2 = 3, grid3 = 31, seed = 123 ) # Compute operating characteristics for a single p vector simulate_oc(test_nested, p=c(0.30,0.30,0.40), endpoint = 'nested', seed=123) # Compute operating characteristics for multiple p vector simulate_oc(test_nested, p=list(c(0.30,0.30,0.40),c(0.35,0.35,0.30)), endpoint = 'nested', seed=123)
summarize main results for a given BOP2FE designs
## S3 method for class 'bop2fe' summary(object, ...)## S3 method for class 'bop2fe' summary(object, ...)
object |
the object returned by BOP2FE_xx |
... |
additional parameters |
summary() returns a list depending on the object entered including design parameters,
boundary, operating characteristics.