# two-arm randomized clinical trial with a normally distributed endpoint
# 90% power to detect mean difference of 15 with a standard deviation of 50
# Design the Stage I Trial with 3 looks and Lan-DeMets O'Brien-Fleming type
# spending function
delta <- 15
sigma <- 50
(des1 <- getDesignMeanDiff(
beta = 0.1, meanDiff = delta, stDev = sigma,
kMax = 3, alpha = 0.025, typeAlphaSpending = "sfOF"
))
s1 <- des1$byStageResults$informationRates
b1 <- des1$byStageResults$efficacyBounds
n <- des1$overallResults$numberOfSubjects
# Monitoring the Stage I Trial
L <- 1
nL <- des1$byStageResults$numberOfSubjects[L]
deltahat <- 8
sigmahat <- 55
sedeltahat <- sigmahat * sqrt( 4 / nL)
zL <- deltahat / sedeltahat
# Making an Adaptive Change: Stage I to Stage II
# revised clinically meaningful difference downward to 10 power the study
# retain the standard deviation at the design stage
# Muller & Schafer (2001) method to design the secondary trial
# with 2 looks and Lan-DeMets Pocock type spending function
# re-estimate sample size to reach 90% conditional power
deltaNew <- 10
(des2 <- adaptDesign(
betaNew = 0.1, L = L, zL = zL, theta = deltaNew,
IMax = n / (4 * sigma^2), kMax = 3, informationRates = s1,
alpha = 0.025, typeAlphaSpending = "sfOF",
MullerSchafer = TRUE, kNew = 2, typeAlphaSpendingNew = "sfP"
))
INew <- des2$secondaryTrial$maxInformation
(nNew <- ceiling(INew * 4 * sigma^2))
(nTotal <- nL + nNew)
# Monitoring the Integrated Trial
s2 <- des2$secondaryTrial$informationRates
Lc <- 2
deltahatc <- 9.5
sigmahatc <- 52.759
L2 <- Lc - L
nL2 <- nNew * s2[L2]
nc <- nL + nL2
sedeltahatc <- sigmahatc * sqrt(4 / nc)
zLc <- deltahatc / sedeltahatc
zL2 <- (zLc * sqrt(nc) - zL * sqrt(nL)) / sqrt(nL2)
getADRCI(
L = L, zL = zL, IMax = n / (4 * sigmahatc^2), kMax = 3,
informationRates = s1, alpha = 0.025, typeAlphaSpending = "sfOF",
MullerSchafer = TRUE, Lc = Lc, zLc = zLc,
INew = nNew / (4 * sigmahatc^2), informationRatesNew = s2,
typeAlphaSpendingNew = "sfP")
Run the code above in your browser using DataLab