Package 'bpp'

Title: Computations Around Bayesian Predictive Power
Description: Implements functions to update Bayesian Predictive Power Computations after not stopping a clinical trial at an interim analysis. Such an interim analysis can either be blinded or unblinded. Code is provided for Normally distributed endpoints with known variance, with a prominent example being the hazard ratio.
Authors: Kaspar Rufibach, Paul Jordan, Markus Abt
Maintainer: Kaspar Rufibach <[email protected]>
License: GPL (>= 2)
Version: 1.0.4
Built: 2025-01-13 03:02:05 UTC
Source: https://github.com/cran/bpp

Help Index


Tools for Computation of Bayesian Predictive Power for a Normally Distributed Endpoint with Known Variance

Description

Implements functions to update Bayesian Predictive Power Computations after not stopping a clinical trial at an interim analysis, whether blinded or unblinded, for a Normally distributed endpoint with known variance, with a prominent example being the hazard ratio.

Details

Package: bpp
Type: Package
Version: 1.0.4
Date: 2022-01-13
License: GPL (>=2)
LazyLoad: yes

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Basic plot functions to illustrate prior and posterior densities when considering a time-to-event endpoint

Description

Basic plot function, labels are specific to the hazard ratio, i.e. when looking at a time-to-event endpoint.

Usage

basicPlot(leg = TRUE, IntEffBoundary = NA, IntFutBoundary = NA, successmean = NA, 
       priormean = NA)

Arguments

leg

logical, display legend?

IntEffBoundary

Interim efficacy boundary.

IntFutBoundary

Interim futility boundary.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

priormean

Mean of the prior.

Value

Empty generic plot.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Bayesian Predictive Power (BPP) for Normally Distributed Endpoint

Description

Compute BPP for a Normally distributed endpoint, e.g. log(hazard ratio).

Usage

bpp(prior = c("normal", "flat"), successmean, finalSE, priormean, ...)

Arguments

prior

Prior density on effect sizes.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

finalSE

(Known) standard error at which the final analysis of the study under consideration takes place.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp for examples).

Value

A real number, the bpp.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Bayesian Predictive Power (BPP) for Normally Distributed Endpoint

Description

Compute BPP and posterior density for a Normally distributed endpoint, e.g. log(hazard ratio), assuming either an unblinded or blinded interim result.

Usage

bpp_1interim(prior = c("normal", "flat"), interimSE, finalSE, successmean, 
                            IntEffBoundary, IntFutBoundary, IntFix, priormean, 
                            propA = 0.5, thetas, ...)

Arguments

prior

Prior density on effect sizes.

interimSE

(Known) standard error of estimate at interim analysis.

finalSE

(Known) standard error at which the final analysis of the study under consideration takes place.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

IntEffBoundary

Efficacy boundary at the interim analysis.

IntFutBoundary

Futility boundary at the interim analysis.

IntFix

Effect sizes observed at the interim analyis, to compute BPP for an unblinded interim analysis.

priormean

Prior mean.

propA

Proportion of subjects randomized to arm A.

thetas

Grid to compute posterior density on.

...

Further arguments specific to the chosen prior (see bpp_1interim for examples).

Value

A list containing the following elements:

initial BPP

BPP based on the prior.

conditional power interval

Conditional power, updating power at design stage with interval knowledge, i.e. corresponding to IntEffBoundary and IntFutBoundary.

BPP after not stopping at interim interval

BPP after not stopping at a blinded interim, provides the results corresponding to IntEffBoundary and IntFutBoundary.

BPP after not stopping at interim exact

BPP after not stopping at an unblinded interim, provides the results corresponding to IntFix.

posterior density exact

The posterior density, exact knowledge of interim result, i.e. corresponding to IntFix.

posterior density interval

The posterior density, interval knowledge, i.e. corresponding to IntEffBoundary and IntFutBoundary.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# ------------------------------------------------------------------------------------------
# Reproduce all the computations in Rufibach et al (2016a) for a Normal prior.
# ------------------------------------------------------------------------------------------

# ------------------------------------------
# set all parameters:
# ------------------------------------------
# prior mean / sd
hr0 <- 0.85
sd0 <- 0.11
priormean <- log(hr0)

# specifications for pivotal study
propA <- 0.5   # proportion of patients randomized to arm A
fac <- (propA * (1 - propA)) ^ (-1)
nevents <- c(0.5, 1) * 1600
finalSE <- sqrt(fac / nevents[2])
alphas <- c(0.001, 0.049)
za <- qnorm(1 - alphas / 2)
hrMDD <- exp(- za * sqrt(fac / nevents))
successmean <- log(hrMDD[2])

# efficacy and futility interim boundary
effi <- log(hrMDD[1])
futi <- log(1.025)

# grid to compute densities on
thetas <- seq(-0.65, 0.3, by = 0.01)

# ------------------------------------------
# compare Normal and flat prior density
# ------------------------------------------
par(las = 1, mar = c(9, 5, 2, 1), mfrow = c(1, 2))
plot(0, 0, type = "n", xlim = c(-0.6, 0.3), ylim = c(-0.1, 5), xlab = "", ylab = "density", 
     main = "")
title(expression("Normal and flat prior density for "*theta), line = 0.7)
basicPlot(leg = FALSE, IntEffBoundary = effi, IntFutBoundary = futi, successmean = successmean, 
          priormean = priormean)
lines(thetas, dnorm(thetas, mean = log(hr0), sd = sd0), col = 2, lwd = 2)

# flat prior:
hr0flat <- 0.866
width1 <- 0.21
height1 <- 2.48

lines(thetas, dUniformNormalTails(thetas, mu = log(hr0flat), width = width1, height = height1), 
      lwd = 2, col = 3)

# ------------------------------------------
# computations for Normal prior
# ------------------------------------------

# prior probabilities to be below 0.7 or above 1:
lims <- c(0.7, 1)
pnorm1 <- plnorm(lims[1], meanlog = log(hr0), sdlog = sd0, lower.tail = TRUE, log.p = FALSE)   
# pnorm(log(lims[1]), mean = log(hr0), sd = sd0)
pnorm2 <- plnorm(lims[2], meanlog = log(hr0), sdlog = sd0, lower.tail = FALSE, log.p = FALSE)  
# 1 - pnorm(log(lims[2]), mean = log(hr0), sd = sd0)

# initial bpp
bpp0 <- bpp(prior = "normal", successmean = successmean, finalSE = finalSE, 
            priormean = log(hr0), priorsigma = sd0)

# update prior with first external study
hr1 <- 0.396
sd1 <- 0.837
up1 <- NormalNormalPosterior(datamean = log(hr1), sigma = sd1, n = 1, 
                             nu = log(hr0), tau = sd0)
bpp1 <- bpp(prior = "normal", successmean = successmean, finalSE = finalSE, 
            priormean = up1$postmean, priorsigma = up1$postsigma)

# update prior with second external study (result derived from pooled analysis: 
# Cox regression on patient level, stratified by study):
hr2 <- 0.287
sd2 <- 0.658
up2 <- NormalNormalPosterior(datamean = log(hr2), sigma = sd2, n = 1, nu = log(hr0), tau = sd0)
bpp2 <- bpp(prior = "normal", successmean = successmean, finalSE = finalSE, 
            priormean = up2$postmean, priorsigma = up2$postsigma)

# compute bpp after not stopping at interim:
# assuming both boundaries:
bpp3.tmp <- bpp_1interim(prior = "normal", interimSE = sqrt(fac / nevents[1]), 
                         finalSE = finalSE, successmean = successmean, 
                         IntEffBoundary = effi, IntFutBoundary = futi, IntFix = log(1), 
                         priormean = up2$postmean, propA = 0.5, thetas, 
                         priorsigma = up2$postsigma)
bpp3 <- bpp3.tmp$"BPP after not stopping at interim interval"
post3 <- bpp3.tmp$"posterior density interval"

# assuming only efficacy boundary:
bpp3_effi_only <- bpp_1interim(prior = "normal", interimSE = sqrt(fac / nevents[1]), 
                               finalSE = finalSE, successmean = successmean, 
                               IntEffBoundary = effi, IntFutBoundary = log(Inf), IntFix = log(1), 
                               priormean = up2$postmean, propA = 0.5, thetas = thetas, 
                               priorsigma = 
                               up2$postsigma)$"BPP after not stopping at interim interval"

# assuming only futility boundary:
bpp3_futi_only <- bpp_1interim(prior = "normal", interimSE = sqrt(fac / nevents[1]), 
                               finalSE = finalSE, successmean = successmean, 
                               IntEffBoundary = log(0), IntFutBoundary = futi, IntFix = log(1), 
                               priormean = up2$postmean, propA = 0.5, thetas = thetas, 
                               priorsigma = 
                               up2$postsigma)$"BPP after not stopping at interim interval"

# assuming interim efficacy boundary: 
bpp4.tmp <- bpp_1interim(prior = "normal", interimSE = sqrt(fac / nevents[1]), 
                         finalSE = finalSE, successmean = successmean, IntEffBoundary = effi, 
                         IntFutBoundary = Inf, IntFix = c(effi, futi), priormean = up2$postmean, 
                         propA = 0.5, thetas, priorsigma = up2$postsigma)
bpp4 <- bpp4.tmp$"BPP after not stopping at interim exact"[2, 1]
post4 <- bpp4.tmp$"posterior density exact"[, 1]

# assuming interim futility boundary: 
bpp5.tmp <- bpp_1interim(prior = "normal", interimSE = sqrt(fac / nevents[1]), 
                         finalSE = finalSE, successmean = successmean, IntEffBoundary = effi, 
                         IntFutBoundary = Inf, IntFix = futi, priormean = up2$postmean, 
                         propA = 0.5, thetas, priorsigma = up2$postsigma)
bpp5 <- bpp5.tmp$"BPP after not stopping at interim exact"[2, 1]
post5 <- bpp5.tmp$"posterior density exact"     # same as post4[, 2]

# ------------------------------------------
# reproduce plots in paper
# ------------------------------------------

# first two updates
par(las = 1, mar = c(9, 5, 2, 1), mfrow = c(1, 2))
plot(0, 0, type = "n", xlim = c(-0.6, 0.3), ylim = c(-0.1, 5), xlab = "", ylab = "density", 
     main = "")
title(expression("Normal prior density and corresponding posteriors for "*theta), line = 0.7)
basicPlot(leg = FALSE, IntEffBoundary = effi, IntFutBoundary = futi, successmean = successmean, 
          priormean = priormean)
lines(thetas, dnorm(thetas, mean = log(hr0), sd = sd0), col = 2, lwd = 2)
lines(thetas, dnorm(thetas, mean = up1$postmean, sd = up1$postsigma), col = 3, lwd = 2)
lines(thetas, dnorm(thetas, mean = up2$postmean, sd = up2$postsigma), col = 4, lwd = 2)
lines(thetas, post3, col = 1, lwd = 2)
legend(-0.64, 5.2, c("prior", "posterior after Sub1", "posterior after Sub1 & Sub2", 
                     "posterior after Sub1 & Sub2 and not stopping at interim"), 
       lty = 1, col = c(2:4, 1), bty = "n", lwd = 2)

# posterior densities for interval knowledge and thetahat equal to boundaries:
plot(0, 0, type = "n", xlim = c(-0.6, 0.3), ylim = c(-0.1, 8), xlab = "", ylab = "density", 
     main = "")
title(expression("Posteriors for "*theta*" after not stopping at interim, for Normal prior"), 
      line = 0.7)
basicPlot(leg = FALSE, IntEffBoundary = effi, IntFutBoundary = futi, successmean = successmean, 
          priormean = priormean)
lines(thetas, post3, col = 1, lwd = 2)
lines(thetas, post4, col = 2, lwd = 2)
lines(thetas, post5, col = 3, lwd = 2)

leg2 <- c("interval knowledge", 
          expression(hat(theta)*" = efficacy boundary"), 
          expression(hat(theta)*" = futility boundary")
)

legend(-0.62, 8.2, leg2, lty = 1, col = 1:3, lwd = 2, bty = "n", 
       title = "posterior after not stopping at interim,")

# ------------------------------------------------------------------------------------------
# Reproduce all the computations in Rufibach et al (2016a) for flat prior.
# ------------------------------------------------------------------------------------------

# ------------------------------------------
# set all parameters first:
# ------------------------------------------

# parameters of flat prior:
priormean <- log(hr0flat)

# ------------------------------------------
# computations for flat prior
# ------------------------------------------

# prior probabilities to be below 0.7 or above 1:
lims <- c(0.7, 1)
flat1 <- pUniformNormalTails(x = log(lims[1]), mu = priormean, width = width1, height = height1)
flat2 <- 1 - pUniformNormalTails(x = log(lims[2]), mu = priormean, 
                                 width = width1, height = height1)

# prior
bpp0_1 <- bpp(prior = "flat", successmean = successmean, finalSE = finalSE, 
              priormean = priormean, width = width1, height = height1)

# update with first external study
hr1 <- 0.396
sd1 <- 0.837
bpp1_1 <- integrate(FlatNormalPosterior, lower = -Inf, upper = Inf, successmean = successmean, 
                     finalSE = finalSE, interimmean = log(hr1), interimSE = sd1, 
                     priormean = priormean, width = width1, height = height1)$value

# update prior (result derived from pooled analysis: Cox regression on patient level, 
# stratified by study)
hr2 <- 0.287
sd2 <- 0.658
bpp2_1 <- integrate(FlatNormalPosterior, -Inf, Inf, successmean = successmean, 
                     finalSE = finalSE, interimmean = log(hr2), 
                     interimSE = sd2, priormean = priormean, 
                     width = width1, height = height1)$value

# update after not stopping at interim
# first compute synthesized prior:
hr0 <- 0.85
sd0 <- 0.11
up2 <- NormalNormalPosterior(datamean = log(hr2), sigma = sd2, n = 1, nu = log(hr0), tau = sd0)

# assuming both boundaries:
bpp3.tmp_1 <- bpp_1interim(prior = "flat", interimSE = sqrt(fac / nevents[1]), 
                         finalSE = finalSE, successmean = successmean, 
                         IntEffBoundary = effi, IntFutBoundary = futi, IntFix = log(1), 
                         priormean = up2$postmean, propA = 0.5, thetas, 
                         width = width1, height = height1)
bpp3_1 <- bpp3.tmp_1$"BPP after not stopping at interim interval"
post3_1 <- bpp3.tmp_1$"posterior density interval"

# assuming only efficacy boundary:
bpp3_1_effi_only <- bpp_1interim(prior = "flat", interimSE = sqrt(fac / nevents[1]), 
                               finalSE = finalSE, successmean = successmean, 
                               IntEffBoundary = effi, IntFutBoundary = log(Inf), IntFix = log(1), 
                               priormean = up2$postmean, propA = 0.5, thetas = thetas, 
                               width = width1, 
                               height = height1)$"BPP after not stopping at interim interval"

# assuming only futility boundary:
bpp3_1_futi_only <- bpp_1interim(prior = "flat", interimSE = sqrt(fac / nevents[1]), 
                               finalSE = finalSE, successmean = successmean, 
                               IntEffBoundary = log(0), IntFutBoundary = futi, IntFix = log(1), 
                               priormean = up2$postmean, propA = 0.5, thetas = thetas, 
                               width = width1, 
                               height = height1)$"BPP after not stopping at interim interval"

# assuming interim efficacy boundary: 
bpp4_1.tmp <- bpp_1interim(prior = "flat", interimSE = sqrt(fac / nevents[1]), 
                               finalSE = finalSE, successmean = successmean, 
                               IntEffBoundary = log(0), IntFutBoundary = effi, IntFix = effi, 
                               priormean = up2$postmean, propA = 0.5, thetas = thetas, 
                               width = width1, height = height1)
bpp4_1 <- bpp4_1.tmp$"BPP after not stopping at interim exact"[2, 1]
post4_1 <- bpp4_1.tmp$"posterior density exact"

# assuming interim futility boundary: 
bpp5_1 <- integrate(Vectorize(estimate_toIntegrate), lower = -Inf, upper = Inf, prior = "flat",
                    successmean = successmean, finalSE = finalSE, interimmean = futi, 
                    interimSE = sqrt(fac / nevents[1]), priormean = up2$postmean, width = width1, 
                    height = height1)$value


bpp5_1.tmp <- bpp_1interim(prior = "flat", interimSE = sqrt(fac / nevents[1]), 
                               finalSE = finalSE, successmean = successmean, 
                               IntEffBoundary = log(0), IntFutBoundary = effi, IntFix = futi, 
                               priormean = up2$postmean, propA = 0.5, thetas = thetas, 
                               width = width1, height = height1)
bpp5_1 <- bpp5_1.tmp$"BPP after not stopping at interim exact"[2, 1]
post5_1 <- bpp5_1.tmp$"posterior density exact"


# ------------------------------------------
# plots for flat prior
# ------------------------------------------

# first two updates with external studies
# compute posteriors
flatpost1 <- rep(NA, length(thetas))
flatpost2 <- flatpost1
for (i in 1:length(thetas)){
  flatpost1[i] <- estimate_posterior(x = thetas[i], prior = "flat", interimmean = log(hr1), 
                                     interimSE = sd1, priormean = priormean, 
                                     width = width1, height = height1)
  flatpost2[i] <- estimate_posterior(x = thetas[i], prior = "flat", interimmean = log(hr2), 
                                     interimSE = sd2, priormean = priormean, 
                                     width = width1, height = height1)
}

par(las = 1, mar = c(9, 5, 2, 1), mfrow = c(1, 2))
plot(0, 0, type = "n", xlim = c(-0.6, 0.3), ylim = c(-0.10, 5), xlab = "", ylab = "density", 
     main = "")
title(expression("Flat prior density and corresponding posteriors for "*theta), line = 0.7)
basicPlot(leg = FALSE, IntEffBoundary = effi, IntFutBoundary = futi, successmean = successmean, 
          priormean = priormean)
lines(thetas, dUniformNormalTails(thetas, mu = priormean, width = width1, height = height1), 
      lwd = 2, col = 2)
lines(thetas, flatpost1, col = 3, lwd = 2)
lines(thetas, flatpost2, col = 4, lwd = 2)
lines(thetas, post3_1, col = 1, lwd = 2)

legend(-0.64, 5.2, c("prior", "posterior after Sub1", "posterior after Sub1 & Sub2", 
                     "posterior after Sub1 & Sub2 and not stopping at interim"), lty = 1, 
                     col = c(2:4, 1), bty = "n", lwd = 2)

# posterior densities for interval knowledge and thetahat equal to boundaries:
plot(0, 0, type = "n", xlim = c(-0.6, 0.3), ylim = c(-0.10, 8), xlab = "", ylab = "density", 
     main = "")
title(expression("Posteriors for "*theta*" after not stopping at interim, for Flat prior"), 
      line = 0.7)
basicPlot(leg = FALSE, IntEffBoundary = effi, IntFutBoundary = futi, successmean = successmean, 
          priormean = priormean)
lines(thetas, post3_1, col = 1, lwd = 2)
lines(thetas, post4_1, col = 2, lwd = 2)
lines(thetas, post5_1, col = 3, lwd = 2)

leg.flat <- c("interval knowledge", 
              expression(hat(theta)*" = efficacy boundary"), 
              expression(hat(theta)*" = futility boundary")
)

legend(-0.62, 8.2, leg.flat, lty = 1, col = 1:3, lwd = 2, bty = "n", 
       title = "posterior after not stopping at interim,")

# ------------------------------------------
# reproduce Table 1 in Rufibach et al (2016a)
# ------------------------------------------
mat <- matrix(NA, ncol = 2, nrow = 10)
mat[, 1] <- c(pnorm1, pnorm2, bpp0, bpp1, bpp2, bpp3, bpp3_futi_only, bpp3_effi_only, 
              bpp4, bpp5)
mat[, 2] <- c(flat1, flat2, bpp0_1, bpp1_1, bpp2_1, bpp3_1, bpp3_1_futi_only, 
              bpp3_1_effi_only, bpp4_1, bpp5_1)
colnames(mat) <- c("Normal prior", "Flat prior")
rownames(mat) <- c(paste("Probability for hazard ratio to be $le$ ", lims[1], sep = ""), 
paste("Probability for hazard ratio to be $ge$ ", lims[2], sep = ""), 
"PoS based on prior distribution", "PoS after Sub1", "PoS after Sub1 and Sub2", 
"PoS after not stopping at interim, assuming $inte{hat theta} in [effi{theta}, futi{theta}]$", 
"PoS after not stopping at interim, assuming $inte{hat theta} in [-infty, futi{theta}]$", 
"PoS after not stopping at interim, assuming $inte{hat theta} in [effi{theta}, infty]$", 
"PoS after not stopping at interim, assuming $inte{hat theta} = effi{theta}$", 
"PoS after not stopping at interim, assuming $inte{hat theta} = futi{theta}$")
as.data.frame(format(mat, digits = 2))

Bayesian Predictive Power (BPP) for Binary Endpoint

Description

Compute BPP and posterior density for a binary endpoint, e.g. response proportions, assuming either an unblinded or blinded interim result.

Usage

bpp_1interim_binary(prior = c("normal", "flat"), successdelta, pi1, n1,
                                pi2, n2, IntEffBoundary, IntFutBoundary, 
                                IntFix, priormean, propA = 0.5, thetas, ...)

Arguments

prior

Prior density on effect sizes.

successdelta

The proportion difference that defines success at the final analysis. We assume that higher proportions are better, e.g. as for response in oncology. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

pi1

Assumed response proportion in intervention arm.

n1

2-d vector of sample sizes in intervention arm, at interim and final analysis.

pi2

Assumed response proportion in control arm.

n2

2-d vector of sample sizes in control arm, at interim and final analysis.

IntEffBoundary

Efficacy boundary at the interim analysis.

IntFutBoundary

Futility boundary at the interim analysis.

IntFix

Effect sizes observed at the interim analyis, to compute BPP for an unblinded interim analysis.

priormean

Prior mean.

propA

Proportion of subjects randomized to arm A.

thetas

Grid to compute posterior density on.

...

Further arguments specific to the chosen prior (see bpp_1interim_binary for examples).

Value

A list containing the following elements:

initial BPP

BPP based on the prior.

BPP after not stopping at interim interval

BPP after not stopping at a blinded interim, provides the results corresponding to IntEffBoundary and IntFutBoundary.

BPP after not stopping at interim exact

BPP after not stopping at an unblinded interim, provides the results corresponding to IntFix.

posterior density interval

The posterior density, interval knowledge, i.e. corresponding to IntEffBoundary and IntFutBoundary.

posterior power interval

The posterior power, interval knowledge, i.e. corresponding to IntEffBoundary and IntFutBoundary.

posterior density exact

The posterior density, exact knowledge of interim result, i.e. corresponding to IntFix.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

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

Bayesian Predictive Power (BPP) for Continuous Endpoint

Description

Compute BPP and posterior density for a continuous endpoint, e.g. mean difference, assuming either an unblinded or blinded interim result.

Usage

bpp_1interim_continuous(prior = c("normal", "flat"), successmean, stDev, 
                                    n1, n2, IntEffBoundary, IntFutBoundary, IntFix, 
                                    priormean, propA = 0.5, thetas, ...)

Arguments

prior

Prior density on effect sizes.

successmean

The mean difference that defines success at the final analysis. We assume that a higher mean is better. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

stDev

Standard deviation of measurements in one group. Used to compute standard error at final analysis.

n1

2-d vector of sample sizes in intervention arm, at interim and final analysis.

n2

2-d vector of sample sizes in control arm, at interim and final analysis.

IntEffBoundary

Efficacy boundary at the interim analysis.

IntFutBoundary

Futility boundary at the interim analysis.

IntFix

Effect sizes observed at the interim analyis, to compute BPP for an unblinded interim analysis.

priormean

Prior mean.

propA

Proportion of subjects randomized to arm A.

thetas

Grid to compute posterior density on.

...

Further arguments specific to the chosen prior (see bpp_1interim_continuous for examples).

Value

A list containing the following elements:

initial BPP

BPP based on the prior.

BPP after not stopping at interim interval

BPP after not stopping at a blinded interim, provides the results corresponding to IntEffBoundary and IntFutBoundary.

BPP after not stopping at interim exact

BPP after not stopping at an unblinded interim, provides the results corresponding to IntFix.

posterior density interval

The posterior density, interval knowledge, i.e. corresponding to IntEffBoundary and IntFutBoundary.

posterior power interval

The posterior power, interval knowledge, i.e. corresponding to IntEffBoundary and IntFutBoundary.

posterior density exact

The posterior density, exact knowledge of interim result, i.e. corresponding to IntFix.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# standard deviation of measurments in one group
stDev <- 24

# number of patients at interim
n1_int <- 46
n2_int <- 46

# number of patients at final analysis
n1 <- 92
n2 <- 92

# MDD at final analysis (corresponds to delta = 10 for 80% power)
mdd <- 7.023506

# efficacy boundary
effi <- 15

# futility boundary --> chosen informally
futi <- 0

# prior
priormean <- 12.3
sd0 <- 4.2

# flat prior
width1 <- 25
height1 <- 0.02

thetas <- seq(-0.65, 0.3, by = 0.01)

bpp_1interim_continuous(prior = "normal", successmean = mdd, stDev = stDev, 
                                 n1 = c(n1_int, n1), n2 = c(n2_int, n2), 
                                 IntEffBoundary = effi, IntFutBoundary = futi, IntFix = 1, 
                                 priormean = priormean, propA = 0.5, thetas, 
                                 priorsigma = sd0)[[1]]
bpp_1interim_continuous(prior = "flat", successmean = mdd, stDev = stDev, 
                                   n1 = c(n1_int, n1), n2 = c(n2_int, n2), IntEffBoundary = effi, 
                                   IntFutBoundary = futi, IntFix = 1, 
                                   priormean = 12.3, propA = 0.5, thetas = thetas, 
                                   width = width1, height = height1)[[1]]

Bayesian Predictive Power (BPP) for Time-to-Event Endpoint

Description

Compute BPP and posterior density for a time-to-event endpoint, e.g. hazard ratio, assuming either an unblinded or blinded interim result.

Usage

bpp_1interim_t2e(prior = c("normal", "flat"), successHR, d,
                             IntEffBoundary, IntFutBoundary, IntFixHR, 
                             priorHR, propA = 0.5, thetas, ...)

Arguments

prior

Prior density on effect sizes.

successHR

The hazard ratio that defines success at the final analysis. We assume that hazard ratios below 1 are beneficial. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

d

2-d vector with number of events at interim and final analysis. Used to compute standard errors.

IntEffBoundary

Efficacy boundary at the interim analysis, hazard ratio.

IntFutBoundary

Futility boundary at the interim analysis, hazard ratio.

IntFixHR

Effect sizes observed at the interim analyis, to compute BPP for an unblinded interim analysis.

priorHR

Hazard ratio at which prior is centered.

propA

Proportion of subjects randomized to arm A.

thetas

Grid to compute posterior density on.

...

Further arguments specific to the chosen prior (see bpp_1interim_t2e for examples).

Value

A list containing the following elements:

initial BPP

BPP based on the prior.

BPP after not stopping at interim interval

BPP after not stopping at a blinded interim, provides the results corresponding to IntEffBoundary and IntFutBoundary.

BPP after not stopping at interim exact

BPP after not stopping at an unblinded interim, provides the results corresponding to IntFix.

posterior density interval

The posterior density, interval knowledge, i.e. corresponding to IntEffBoundary and IntFutBoundary.

posterior power interval

The posterior power, interval knowledge, i.e. corresponding to IntEffBoundary and IntFutBoundary.

posterior density exact

The posterior density, exact knowledge of interim result, i.e. corresponding to IntFix.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# number of events 
nevents <- c(191, 381)

# MDD at final analysis
hrMDD <-  0.8172823

# efficacy boundary
hrEffi <- 0.6508829

# futility boundary --> chosen informally
hrFuti <- 1

# prior specifications

# Normal prior corresponding to information of 50 events in 1:1 randomized trial
hr0 <- 0.7
sd0 <- sqrt(4 / 50)

# flat prior
width1 <- 0.5
height1 <- 1

# compute bpps
thetas <- seq(0.5, 1.35, by = 0.01)
bpp1b <- bpp_1interim_t2e(prior = "normal", successHR = hrMDD, d = nevents,
                          IntEffBoundary = hrEffi, IntFutBoundary = hrFuti, 
                          IntFixHR = 1, priorHR = hr0, propA = 0.5, thetas = thetas, 
                          priorsigma = sd0)[[1]]
bpp1_1b <- bpp_1interim_t2e(prior = "flat", successHR = hrMDD, d = nevents, 
                            IntEffBoundary = hrEffi, IntFutBoundary = hrFuti, 
                            IntFixHR = 1, priorHR = hr0, propA = 0.5, thetas = thetas, 
                            width = width1, height = height1)[[1]]

Bayesian Predictive Power (BPP) for Normally Distributed Endpoint

Description

Compute BPP and posterior density for a Normally distributed endpoint, e.g. log(hazard ratio), assuming the trial did not stop at two blinded interim analyses.

Usage

bpp_2interim(prior = "normal", interimSE, finalSE, successmean, IntEffBoundary, 
                    IntFutBoundary, priormean, thetas, ...)

Arguments

prior

Prior density on effect sizes. So far, this function only accomodates a Normal prior, as opposed to bpp_1interim where also the pessimistic prior introduced in Rufibach et al (2016a) can be specified.

interimSE

(Known) standard error of estimate at interim analysis.

finalSE

(Known) standard error at which the final analysis of the study under consideration takes place.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

IntEffBoundary

2-d vector of efficacy boundaries at the interim analyses.

IntFutBoundary

2-d vector of futility boundary at the interim analyses.

priormean

Prior mean.

thetas

Grid to compute posterior density on.

...

Further arguments specific to the chosen prior (see bpp_1interim for examples).

Value

A list containing the following elements:

initial BPP

BPP based on the prior.

BPP after not stopping at interim interval

BPP after not stopping at a blinded interim.

posterior density interval

The posterior density, interval knowledge.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# ------------------------------------------------------------------------------------------
# Illustrate the update after two passed interims using the Gallium clinical trial
# ------------------------------------------------------------------------------------------

# ------------------------------------------
# set all parameters:
# ------------------------------------------
# prior mean / sd
hr0 <- 0.9288563
priormean <- log(hr0)
priorsigma <- sqrt(4 / 12)

# specifications for pivotal study
propA <- 0.5   # proportion of patients randomized to arm A
fac <- (propA * (1 - propA)) ^ (-1)
nevents <- c(111, 248, 370)
interimSE <- sqrt(fac / nevents[1:2])
finalSE <- sqrt(fac / nevents[3])
za <- c(3.9285726330559, 2.5028231888636, 1.9936294555664)
alphas <- 2 * (1 - pnorm(za))
hrMDD <- exp(- za * sqrt(fac / nevents))
successmean <- log(hrMDD[3])

# efficacy and futility interim boundary
effi <- log(c(0, hrMDD[2]))
futi <- log(c(1, Inf))

# grid to compute densities on
thetas <- seq(-0.65, 0.3, by = 0.01)

bpp_2interim(prior = "normal", interimSE = interimSE, finalSE = finalSE, 
             successmean = successmean, IntEffBoundary = effi, IntFutBoundary = futi, 
             priormean = priormean, thetas = thetas, priorsigma = priorsigma)

Bayesian Predictive Power (BPP) for Binary Endpoint

Description

Compute BPP for a binary endpoint.

Usage

bpp_binary(prior = c("normal", "flat"), successdelta, pi1, n1,
                       pi2, n2, priormean, ...)

Arguments

prior

Prior density on effect sizes.

successdelta

The proportion difference that defines success at the final analysis. We assume that higher proportions are better, e.g. as for response in oncology. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

pi1

Assumed response proportion in intervention arm. Used to compute standard error at final analysis.

n1

Sample size in intervention arm. Used to compute standard error at final analysis.

pi2

Assumed response proportion in control arm. Used to compute standard error at final analysis.

n2

Sample size in control arm. Used to compute standard error at final analysis.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp_binary for examples).

Value

A real number, the bpp.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# 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

Bayesian Predictive Power (BPP) for Continuous Endpoint

Description

Compute BPP for a continuous endpoint.

Usage

bpp_continuous(prior = c("normal", "flat"), successmean, stDev, 
                      n1, n2, priormean, ...)

Arguments

prior

Prior density on effect sizes.

successmean

The mean difference that defines success at the final analysis. We assume that a higher mean is better. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

stDev

Standard deviation of measurements in one group. Used to compute standard error at final analysis.

n1

Sample size in intervention arm. Used to compute standard error at final analysis.

n2

Sample size in control arm. Used to compute standard error at final analysis.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp_continuous for examples).

Value

A real number, the bpp.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# standard deviation of measurments in one group
stDev <- 24

# sample size at final analysis
n1 <- 92
n2 <- 92

# MDD at final analysis (corresponds to delta = 10 for 80% power)
mdd <- 7.023506

# prior
priormean <- 12.3

# standard error for prior, based on Phase 2 data
sig1 <- 26.1
n1p <- 25
sig2 <- 33.6
n2p <- 25
sd0 <- sqrt(sig1 ^ 2 / n1p + sig2 ^ 2 / n2p)

# flat prior
width1 <- 25
height1 <- 0.02

# bpps
bpp_continuous(prior = "normal", successmean = mdd, stDev = stDev, 
                        n1 = n1, n2 = n2, priormean = priormean, priorsigma = sd0)
bpp_continuous(prior = "flat", successmean = mdd, stDev = stDev, 
                          n1 = n1, n2 = n2, priormean = priormean, 
                          width = width1, height = height1)

Bayesian Predictive Power (BPP) for Time-To-Event Endpoint

Description

Compute BPP for a time-to-event endpoint.

Usage

bpp_t2e(prior = c("normal", "flat"), successHR, d, propA = 0.5,
                    priorHR, ...)

Arguments

prior

Prior density on effect sizes.

successHR

The hazard ratio that defines success at the final analysis. We assume that a hazard ratio below 1 corresponds to better outcome. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

d

Number of events at final analysis.

propA

Proportion of subjects randomized to arm A.

priorHR

Hazard ratio around which the prior is centered.

...

Further arguments specific to the chosen prior (see bpp_t2e for examples).

Value

A real number, the bpp.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Rufibach, K., Burger, H.U., Abt, M. (2016b). Bayesian Predictive Power: Choice of Prior and some Recommendations for its Use as Probability of Success in Drug Development. Pharm. Stat., 15, 438–446.

Examples

# hazard ratio to beat at final analysis
hrMDD <- 0.8173

# number of events at final analysis
nevents <- 381

# prior
hr0 <- 0.7

# SE for a normal prior corresponding to information of 50 events in 1:1 randomized trial
sd0 <- sqrt(4 / 50)

# parameters of flat prior
width1 <- 0.5
height1 <- 1

# compute bpp
bpp_t2e(prior = "normal", successHR = hrMDD, d = nevents,
                 priorHR = hr0, priorsigma = sd0)
bpp_t2e(prior = "flat", successHR = hrMDD, d = nevents,
                   priorHR = hr0, width = width1, height = height1)

Posterior density conditional on known interim result

Description

If we update the prior with a known estimate at an interim analysis, we get this density.

Usage

estimate_posterior(x, prior = c("normal", "flat"), interimmean, interimSE, priormean, ...)

Arguments

x

Value at which to evaluate the function.

prior

Prior density on effect sizes.

interimmean

Mean of the data.

interimSE

(Known) standard error of interimmean.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp for examples).

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Posterior density conditional on interim result is proportional to the value of this function

Description

If we update the prior with a known estimate at an interim analysis, we get a density that is proportional to the value of this function.

Usage

estimate_posterior_nominator(x, prior = c("normal", "flat"), interimmean, 
                                    interimSE, priormean, ...)

Arguments

x

Value at which to evaluate the function.

prior

Prior density on effect sizes.

interimmean

Mean of the data.

interimSE

(Known) standard error of interimmean.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp for examples).

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Product of posterior density and conditional power for known interim result

Description

Product of posterior density and conditional power for known interim result, integrate over this function to get BPP.

Usage

estimate_toIntegrate(x, prior = c("normal", "flat"), successmean, 
            finalSE, interimmean, interimSE, priormean, propA = 0.5, ...)

Arguments

x

Value at which to evaluate the function.

prior

Prior density on effect sizes.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

finalSE

(Known) standard error at which the final analysis of the study under consideration takes place.

interimmean

Mean of the data.

interimSE

(Known) standard error of interimmean.

priormean

Prior mean.

propA

Proportion of subjects randomized to arm A.

...

Further arguments specific to the chosen prior (see bpp for examples).

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Integrand to compute Bayesian Predictive Power when flat prior has been updated with likelihood

Description

Assume we have a flat prior on our effect, update it with a Normal likelihood and then want to compute Bayesian Predictive Power. This function provides the integrand for that computation, i.e. the product of the power function and the posterior.

Usage

FlatNormalPosterior(x, successmean, finalSE, interimmean, interimSE, priormean, 
                           width, height)

Arguments

x

Value at which to evaluate the function.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

finalSE

(Known) standard error at which the final analysis of the study under consideration takes place.

interimmean

Mean of the data.

interimSE

(Known) standard error of interimmean.

priormean

Prior mean.

width

Width of the flat part of the prior.

height

Height of the flat part of the prior.

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Posterior density conditional on interim result, only known as interval, is proportional to the value of this function

Description

If we update the prior with the knowledge that the interim estimate was between a futility and efficacy boundary at an interim analysis, we get a density that is proportional to the value of this function.

Usage

interval_posterior_nominator(x, prior = c("normal", "flat"), 
          IntEffBoundary, IntFutBoundary, interimSE, priormean, ...)

Arguments

x

Value at which to evaluate the function.

prior

Prior density on effect sizes.

IntEffBoundary

Efficacy boundary at the interim analysis.

IntFutBoundary

Futility boundary at the interim analysis.

interimSE

(Known) standard error of interimmean, i.e. at interim analysis.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp for examples).

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Posterior density conditional on two interim results, both only known as intervals, is proportional to the value of this function

Description

If we update the prior with the knowledge that two interim estimates were between a futility and efficacy boundary, we get a density that is proportional to the value of this function.

Usage

interval_posterior_nominator2(x, prior = "normal", 
          IntEffBoundary, IntFutBoundary, interimSE, priormean, ...)

Arguments

x

Value at which to evaluate the function.

prior

Prior density on effect sizes.

IntEffBoundary

Efficacy boundary at the interim analysis.

IntFutBoundary

Futility boundary at the interim analysis.

interimSE

(Known) standard error of interimmean, i.e. at interim analysis.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp for examples).

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_2interim for code of all the computations in Rufibach et al (2016a).

Product of posterior density and conditional power for blinded interim result

Description

Product of posterior density and conditional power for blinded interim result, integrate over this function to get BPP.

Usage

interval_toIntegrate(x, prior = c("normal", "flat"), interimSE, 
             finalSE, successmean, IntEffBoundary, IntFutBoundary, 
             priormean, ...)

Arguments

x

Value at which to evaluate the function.

prior

Prior density on effect sizes.

interimSE

(Known) standard error of interimmean, i.e. at interim analysis.

finalSE

(Known) standard error at which the final analysis of the study under consideration takes place.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

IntEffBoundary

Efficacy boundary at the interim analysis.

IntFutBoundary

Futility boundary at the interim analysis.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp for examples).

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Product of posterior density and conditional power for blinded interim result

Description

Product of posterior density and conditional power for two blinded interim results, integrate over this function to get BPP.

Usage

interval_toIntegrate2(x, prior = "normal", interimSE, finalSE, successmean, 
                             IntEffBoundary, IntFutBoundary, priormean, ...)

Arguments

x

Value at which to evaluate the function.

prior

Prior density on effect sizes.

interimSE

(Known) standard error of interimmean, i.e. at interim analysis.

finalSE

(Known) standard error at which the final analysis of the study under consideration takes place.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

IntEffBoundary

Efficacy boundary at the interim analysis.

IntFutBoundary

Futility boundary at the interim analysis.

priormean

Prior mean.

...

Further arguments specific to the chosen prior (see bpp for examples).

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_2interim for code of all the computations in Rufibach et al (2016a).

Normal-Normal Posterior in conjugate normal model, for known sigma

Description

Compute the posterior distribution in a conjugate normal model for known variance: Let X1,,XnX_1, \ldots, X_n be a sample from a N(μ,σ2)N(\mu, \sigma^2) distribution, with σ\sigma assumed known. We assume a prior distribution on μ\mu, namely N(ν,τ2)N(\nu, \tau^2). The posterior distribution is then μxN(μp,σp2)\mu|x \sim N(\mu_p, \sigma_p^2) with

μp=(1/(σ2/n)+τ2)1(xˉ/(σ2/n)+ν/τ2)\mu_p = (1 / (\sigma^2 / n) + \tau^{-2})^{-1} (\bar{x} / (\sigma^2/n) + \nu / \tau^2)

and

σp=(1/(σ2/n)+τ2)1.\sigma_p = (1 / (\sigma^2/n) + \tau^{-2})^{-1}.

These formulas are available e.g. in Held (2014, p. 182).

Usage

NormalNormalPosterior(datamean, sigma, n, nu, tau)

Arguments

datamean

Mean of the data.

sigma

(Known) standard deviation of the data.

n

Number of observations.

nu

Prior mean.

tau

Prior standard deviation.

Value

A list with the entries:

postmean

Posterior mean.

postsigma

Posterior standard deviation.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Held, L., Sabanes-Bove, D. (2014). Applied Statistical Inference. Springer.

Examples

## data:
n <- 25
sd0 <- 3
x <- rnorm(n, mean = 2, sd = sd0)

## prior:
nu <- 0
tau <- 2

## posterior:
NormalNormalPosterior(datamean = mean(x), sigma = sd0, 
                      n = n, nu = nu, tau = tau)

Conditional power conditioning on a blinded interim

Description

Conditional power conditioning on a blinded interim, i.e. the estimate after the interim is only known to lie in an interval.

Usage

post_power(x, interimSE, finalSE, successmean, IntEffBoundary, IntFutBoundary)

Arguments

x

Value at which to evaluate the function.

interimSE

(Known) standard error of interimmean.

finalSE

(Known) standard error at which the final analysis of the study under consideration takes place.

successmean

The mean that defines success at the final analysis. Typically chosen to be the minimal detectable difference, i.e. the critical on the scale of the effect size of interest corresponding to the significance level at the final analysis.

IntEffBoundary

Efficacy boundary at the interim analysis.

IntFutBoundary

Futility boundary at the interim analysis.

Value

Value of the function, a real number.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).

Density and CDF for Uniform Distribution with Normal tails

Description

Density function and cumulative distribution function for a Uniform density with Normal tails. Introduced in Rufibach et al (2016a) as pessimistic distribution to compute Bayesian Predictive Power.

Usage

dUniformNormalTails(x, mu, width, height)
pUniformNormalTails(x, mu, width, height)

Arguments

x

Vector of quantiles.

mu

Mean of the pessimistic prior.

width

Width of the flat part of the prior.

height

Height of the flat part of the prior.

Value

Density at x.

Author(s)

Kaspar Rufibach (maintainer)
[email protected]

References

Rufibach, K., Jordan, P., Abt, M. (2016a). Sequentially Updating the Likelihood of Success of a Phase 3 Pivotal Time-to-Event Trial based on Interim Analyses or External Information. J. Biopharm. Stat., 26(2), 191–201.

Examples

# type ?bpp_1interim for code of all the computations in Rufibach et al (2016a).