# 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
# 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))
bpp0 <- bpp_binary(prior = "normal", successdelta = mdd, pi1 = pi1, n1 = n1,
pi2 = pi2, n2 = n2, priormean = priormean, priorsigma = sd0)
bpp0
# prior if flat
width1 <- 0.5
height1 <- 1.5
bpp0_1 <- bpp_binary(prior = "flat", successdelta = mdd, pi1 = pi1, n1 = n1,
pi2 = pi2, n2 = n2, priormean = priormean,
width = width1, height = height1)
bpp0_1
# }
Run the code above in your browser using DataLab