Package 'BOP2FE'

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

Help Index


BOP2-FE design for binary endpoint

Description

Computes stopping boundaries and operating characteristics of Bayesian optimal phase II design with efficacy and futility stopping for a binary endpoint

Usage

BOP2FE_binary(
  H0,
  H1,
  n,
  nsim,
  t1e = NULL,
  method = "power",
  lambda1,
  lambda2,
  grid1,
  gamma1,
  gamma2,
  grid2,
  eta1 = NULL,
  eta2 = NULL,
  grid3 = NULL,
  seed = NULL
)

Arguments

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

Value

An S3 object of class 'bop2fe'

References

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.

Examples

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)

BOP2-FE design for co-primary endpoint

Description

Computes stopping boundaries and operating characteristics of Bayesian optimal phase II design with efficacy and futility stopping for a co-primary endpoint.

Usage

BOP2FE_coprimary(
  H0,
  H1,
  n,
  nsim,
  t1e = NULL,
  method = "power",
  lambda1,
  lambda2,
  grid1,
  gamma1,
  gamma2,
  grid2,
  eta1 = NULL,
  eta2 = NULL,
  grid3 = NULL,
  seed = NULL
)

Arguments

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

Value

An S3 object of class 'bop2fe'

References

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.

Examples

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)

BOP2-FE design for joint efficacy and toxicity endpoint

Description

Computes stopping boundaries and operating characteristics of Bayesian optimal phase II design with efficacy and futility stopping for a joint efficacy and toxicity endpoint.

Usage

BOP2FE_jointefftox(
  H0,
  H1,
  n,
  nsim,
  t1e = NULL,
  method = "power",
  lambda1,
  lambda2,
  grid1,
  gamma1,
  gamma2,
  grid2,
  eta1 = NULL,
  eta2 = NULL,
  grid3 = NULL,
  seed = NULL
)

Arguments

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

Value

An S3 object of class 'bop2fe'

References

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 .

Examples

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)

BOP2-FE design for nested (ordinal) endpoint

Description

Computes stopping boundaries and operating characteristics of Bayesian optimal phase II design with efficacy and futility stopping for a nested (ordinal) endpoint

Usage

BOP2FE_nested(
  H0,
  H1,
  n,
  nsim,
  t1e = NULL,
  method = "power",
  lambda1,
  lambda2,
  grid1,
  gamma1,
  gamma2,
  grid2,
  eta1 = NULL,
  eta2 = NULL,
  grid3 = NULL,
  seed = NULL
)

Arguments

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

Value

An S3 object of class 'bop2fe'

References

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.

Examples

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

Description

Boundary values for binary Endpoint

Usage

get_boundary_binary(
  H0,
  a1,
  b1,
  n,
  lambda,
  gamma,
  eta = NULL,
  method = "power",
  seed = NULL
)

Arguments

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 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.

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

Value

A list with the first element corresponding to futility and the second for efficacy boundaries

Examples

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

Description

Boundary values for co-primary Endpoint

Usage

get_boundary_coprimary(
  H0,
  a,
  n,
  lambda,
  gamma,
  eta = NULL,
  method = "power",
  seed = NULL
)

Arguments

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 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.

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

Value

A list with the first element corresponding to futility and the second for efficacy boundaries

Examples

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

Description

Boundary values for joint Endpoint

Usage

get_boundary_jointefftox(
  H0,
  a,
  n,
  lambda,
  gamma,
  eta = NULL,
  method = "power",
  seed = NULL
)

Arguments

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 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.

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

Value

A list with the first element corresponding to futility and the second for efficacy boundaries

Examples

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

Description

Boundary values for Nested Endpoint

Usage

get_boundary_nested(
  H0,
  a,
  n,
  lambda,
  gamma,
  eta = NULL,
  method = "power",
  seed = NULL
)

Arguments

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 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.

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

Value

A list with the first element corresponding to futility and the second for efficacy boundaries

Examples

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

Description

Operating characteristics for binary Endpoint

Usage

get_oc_binary(p, n, nsim, fb, sb, seed = NULL)

Arguments

p

Response rate

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

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

Value

A data frame with the following columns

lambda:

lambda values for cut-off probability

gamma:

gamma values for cut-off probability

eta:

eta values for cut-off probability

earlystopfuti_mean:

Average number of early stopping due to futility

earlystopsupe_mean:

Average number of early stopping for futility due to efficacy

ss_mean:

Average sample size

rejectnull_mean:

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.

earlystopfuti_sum:

Total number of early stopping due to futility

earlystopsupe_sum:

Total number of early early stopping due to efficacy

ss_sum:

Sum of sample sizes across simulation

rejectnull_sum:

Total number of hypothesis rejection at the final analysis

Examples

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

Description

Operating characteristics for for coprimary Endpoint

Usage

get_oc_coprimary(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL)

Arguments

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 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

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

Value

A data frame with the following columns

lambda:

lambda values for cut-off probability

gamma:

gamma values for cut-off probability

eta:

eta values for cut-off probability

earlystopfuti_mean:

Average number of early stopping due to futility

earlystopsupe_mean:

Average number of early stopping for futility due to efficacy

ss_mean:

Average sample size"

rejectnull_mean:

"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.

earlystopfuti_sum:

Total number of early stopping due to futility

earlystopsupe_sum:

Total number of early early stopping due to efficacy

ss_sum:

Sum of sample sizes across simulation"

rejectnull_sum:

Total number of hypothesis rejection at the final analysis

Examples

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

Description

Operating characteristics for for joint Endpoint

Usage

get_oc_jointefftox(p1, p2, p3, p4, n, nsim, fb, sb, seed = NULL)

Arguments

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 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

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

Value

A data frame with the following columns

lambda:

lambda values for cut-off probability

gamma:

gamma values for cut-off probability

eta:

eta values for cut-off probability

earlystopfuti_mean:

Average number of early stopping due to futility

earlystopsupe_mean:

Average number of early stopping for futility due to efficacy

ss_mean:

Average sample size"

rejectnull_mean:

"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.

earlystopfuti_sum:

Total number of early stopping due to futility

earlystopsupe_sum:

Total number of early early stopping due to efficacy

ss_sum:

Sum of sample sizes across simulation"

rejectnull_sum:

Total number of hypothesis rejection at the final analysis

Examples

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

Description

Operating characteristics for Nested Endpoint

Usage

get_oc_nested(p1, p2, p3, n, nsim, fb, sb, seed = NULL)

Arguments

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 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

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

Value

A data frame with the following columns

lambda:

lambda values for cut-off probability

gamma:

gamma values for cut-off probability

eta:

eta values for cut-off probability

earlystopfuti_mean:

Average number of early stopping due to futility

earlystopsupe_mean:

Average number of early stopping for futility due to efficacy

ss_mean:

Average sample size"

rejectnull_mean:

"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.

earlystopfuti_sum:

Total number of early stopping due to futility

earlystopsupe_sum:

Total number of early early stopping due to efficacy

ss_sum:

Sum of sample sizes across simulation"

rejectnull_sum:

Total number of hypothesis rejection at the final analysis

Examples

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 cut-off probability and simulation results for BOP2FE designs

Description

Plot the objects returned by other functions, including (1) cut-off probability; (2) boundary values; (3) operating characteristics

Usage

## S3 method for class 'bop2fe'
plot(x, ...)

Arguments

x

the object returned by BOP2FE_xx

...

additional parameters

Value

plot() returns a figure depending on the object entered


Compute operating characteristics at the optimal boundary

Description

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.

Usage

simulate_oc(object, p, endpoint, seed = NULL)

Arguments

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

Value

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

Examples

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

Description

summarize main results for a given BOP2FE designs

Usage

## S3 method for class 'bop2fe'
summary(object, ...)

Arguments

object

the object returned by BOP2FE_xx

...

additional parameters

Value

summary() returns a list depending on the object entered including design parameters, boundary, operating characteristics.