# NOT RUN {
# simple example with response proportions
pi1 <- 0.6 # proportion in intervention arm
pi2 <- 0.45 # proportion in control arm
n1 <- 174
n2 <- 174
# MDD at final analysis - proportion difference that corresponds to "success"
mdd <- 0.1
n1_int <- 87
n2_int <- 87
# prior if normal
pi20 <- 0.44
pi10 <- 0.64
n0 <- 50
priormean <- pi10 - pi20
sd0 <- sqrt(pi20 * (1 - pi20) / (n0 / 2) + pi10 * (1 - pi10) / (n0 / 2))
# efficacy boundary
effi <- 0.2
# futility boundary
futi <- 0
thetas <- seq(-0.65, 0.3, by = 0.01)
bpp_1interim_binary(prior = "normal", successdelta = mdd, pi1 = pi1,
n1 = c(n1_int, n1), n2 = c(n2_int, n2),
pi2 = pi2, IntEffBoundary = effi, IntFutBoundary = futi,
IntFix = 1, priormean = priormean, propA = 0.5,
thetas = thetas, priorsigma = sd0)[[1]]
# }
Run the code above in your browser using DataLab