# Setup: 2 active arms vs control in Phase 2; 1 selected arm vs control
# in Phase 3. Phase 3 has 2 sequential looks.
# Information levels: equal spacing over 3 looks based on a maximum of
# 110 patients per arm, SD = 1.0
I <- c(110 / (2 * 1.0^2) * seq(1, 3)/3)
# O'Brien-Fleming efficacy boundaries
b <- c(3.776605, 2.670463, 2.180424)
# No futility stopping
p0 <- exitprob_seamless(M = 2, theta = c(0, 0), K = 2,
b = b, I = I, nthreads = 1)
cumsum(p0$exitProbUpper)
# Add futility stopping
a <- c(0, 0.5, b[3])
p1 <- exitprob_seamless(M = 2, theta = c(0.3, 0.5), K = 2,
b = b, a = a, I = I, nthreads = 1)
cbind(
cumulativeEfficacy = cumsum(p1$exitProbUpper),
cumulativeFutility = cumsum(p1$exitProbLower)
)
Run the code above in your browser using DataLab