simon2stage: Simon 2-stage function

Description Usage Arguments Details Value References Examples

View source: R/simon2stage.R

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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

Details

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

Value

a data.frame with elements

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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)

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)


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

IDDI-BE/PhIIdesign documentation built on June 5, 2021, 2:03 p.m.