The primary objective of a phase II clinical trial of a new drug or regimen is to determine whether it has sufficient biological activity against the disease under study to warrant more extensive development.
This function calculates the sample size needed in a Simon 2-stage design which is a two-stage design that is optimal in the sense that the expected sample size is minimized if the regimen has low activity subject to constraints upon the size of the type 1 and type 2 errors.
Two-stage designs which minimize the maximum sample size are also determined.

simon2stage(
  p0,
  pa,
  alpha,
  beta,
  eps = 0,
  N_min,
  N_max,
  int = 0,
  int_window = 0.025,
  CI_type = "Koyama"
)

Arguments

p0

probability of the uninteresting response (null hypothesis \(H0\))

pa

probability of the interesting response (alternative hypothesis Ha)

alpha

Type I error rate \(P(reject H0|H0)\)

beta

Type II error rate \(P(reject Ha|Ha)\)

eps

tolerance default value = 0.005

N_min

minimum sample size value for grid search

N_max

maximum sample size value for grid search

int

pre-specified interim analysis percentage information

int_window

window around interim analysis percentage (e.g. 0.5 +- 0.025). 0.025 is default value

CI_type

"Koyama", see getCI_Koyama, or any type for binom.confint

Value

a data.frame with elements

  • n1: total number of patients in stage1

  • n2: total number of patients in stage2

  • N: total number of patients=n1+n2

  • r1: threshold for "rejecting" Ha: if x1<=r1 --> stop for futility at first stage

  • r2: threshold for "rejecting" Ha: if x1+x2<=r2 --> futility at second stage

  • eff: (r2 + 1)/N

  • CI_LL: (1-2*alpha) CI lower limit

  • CI_UL: (1-2*alpha) CI upper limit

  • EN.p0: expected sample size under H0

  • PET.p0: probability of terminating the trial at the end of the first stage under H0

  • MIN: column indicating if the design is the minimal design

  • OPT: column indicating if the setting is the optimal design

  • ADMISS: column indicating if the setting is the admissible design

  • alpha: the actual alpha value which is smaller than alpha_param + eps

  • beta: the actual beta value where which is smaller than beta_param + eps

  • p0: your provided p0 value

  • pa: your provided pa value

  • alpha_param: your provided alpha value

  • beta_param: your provided beta value

Details

if x1<=r1 --> stop futility
if (x1+x2)<=r2 --> futility
if (x1+x2)> r2 --> efficacy

References

Simon R. Optimal two-stage designs for phase II clinical trials. Control Clin Trials. 1989;10(1):1-10. doi:10.1016/0197-2456(89)90015-9 Koyama T, Chen H. Proper inference from simon’s two-stage designs. Stat Med. 2008; 27:3145–154;

Examples

samplesize <- simon2stage(p0 = 0.1, pa = 0.3, alpha = 0.05, beta = 0.2,
                          eps = 0.005, N_min = 1, N_max = 50)
plot(samplesize)

# \donttest{
samplesize <- simon2stage(p0 = 0.1, pa = 0.3, alpha = 0.05, beta = 0.2,
                          eps = 0.005, N_min = 1, N_max = 50,int=0.33,int_window=0.025)
plot(samplesize)

# }
# \donttest{
## Example 1
test <- data.frame(p0 = c(0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
                   pa = c(0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7) + 0.2)
test <- merge(test,
              data.frame(alpha = c(0.1, 0.05, 0.05), beta = c(0.1, 0.2, 0.1)))
samplesize <- fleming1stage(p0 = test$p0, pa = test$pa, alpha = test$alpha, beta = test$beta)
samplesize <- simon2stage(p0 = test$p0, pa = test$pa, alpha = test$alpha, beta = test$beta,
                          N_min = 10, N_max = samplesize$N + 15)
optimal_minimax <- lapply(samplesize, FUN=function(x){
  cbind(subset(x, OPT == "Optimal", c("r1","n1","r2","N","EN.p0","PET.p0")),
        subset(x, MIN == "Minimax", c("r1","n1","r2","N","EN.p0","PET.p0")))
})
optimal_minimax <- data.table::rbindlist(optimal_minimax)

## Example 2
test <- data.frame(p0 = c(0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
                   pa = c(0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7) + 0.15)
test <- merge(test,
              data.frame(alpha = c(0.1, 0.05, 0.05), beta = c(0.1, 0.2, 0.1)))
samplesize <- fleming1stage(p0 = test$p0, pa = test$pa, alpha = test$alpha, beta = test$beta)
samplesize <- simon2stage(p0 = test$p0, pa = test$pa, alpha = test$alpha, beta = test$beta,
                          N_min = 25, N_max = samplesize$N + 20)
optimal_minimax <- lapply(samplesize, FUN=function(x){
  cbind(subset(x, OPT == "Optimal", c("r1","n1","r2","N","EN.p0","PET.p0")),
        subset(x, MIN == "Minimax", c("r1","n1","r2","N","EN.p0","PET.p0")))
})
optimal_minimax <- data.table::rbindlist(optimal_minimax)
# }