Skip to contents

This function computes Bayesian posterior probability or posterior predictive probability for binary outcome clinical trials. The function can handle controlled, uncontrolled, and external control designs, using beta-binomial conjugate priors.

Usage

BayesPostPredBinary(
  prob = "posterior",
  design = "controlled",
  theta0,
  n1,
  n2,
  y1,
  y2,
  a1,
  a2,
  b1,
  b2,
  m1,
  m2,
  ne1,
  ne2,
  ye1,
  ye2,
  ae1,
  ae2
)

Arguments

prob

A character string specifying the type of probability to calculate (prob = 'posterior' or prob = 'predictive').

design

A character string specifying the type of design (design = 'controlled', design = 'uncontrolled', or design = 'external').

theta0

A numeric value representing the pre-specified threshold value.

n1

A positive integer representing the number of patients in group 1 for a proof-of-concept (PoC) trial.

n2

A positive integer representing the number of patients in group 2 for the PoC trial.

y1

A non-negative integer representing the observed number of responders in group 1 for the PoC trial.

y2

A non-negative integer representing the observed number of responders in group 2 for the PoC trial.

a1

A positive numeric value representing the first shape parameter of the prior distribution for group 1.

a2

A positive numeric value representing the first shape parameter of the prior distribution for group 2.

b1

A positive numeric value representing the second shape parameter of the prior distribution for group 1.

b2

A positive numeric value representing the second shape parameter of the prior distribution for group 2.

m1

A positive integer representing the number of patients in group 1 for the future trial data.

m2

A positive integer representing the number of patients in group 2 for the future trial data.

ne1

A positive integer representing the number of patients in group 1 for the external data.

ne2

A positive integer representing the number of patients in group 2 for the external data.

ye1

A non-negative integer representing the observed number of responders in group 1 for the external data.

ye2

A non-negative integer representing the observed number of responders in group 2 for the external data.

ae1

A positive numeric value representing the scale parameter (power parameter) for group 1.

ae2

A positive numeric value representing the scale parameter (power parameter) for group 2.

Value

A numeric value representing the Bayesian posterior probability or Bayesian posterior predictive probability.

Details

The function can obtain:

  • Bayesian posterior probability

  • Bayesian posterior predictive probability

The prior distribution of the proportion of responders (πij) for each treatment group (j=1,2) follows a beta distribution. For posterior probability, the posterior distribution of πij follows a beta distribution. For posterior predictive probability, the predictive distribution of future trial data follows a beta-binomial distribution. The function can account for external (historical) data through power priors.

Examples

# Calculate posterior probability with external control
BayesPostPredBinary(
  prob = 'posterior', design = 'external', theta0 = 0.15,
  n1 = 12, n2 = 15, y1 = 7, y2 = 9, a1 = 0.5, a2 = 0.5, b1 = 0.5, b2 = 0.5,
  m1 = NULL, m2 = NULL, ne1 = 12, ne2 = 12, ye1 = 6, ye2 = 6, ae1 = 0.5, ae2 = 0.5
)
#> [1] 0.1399401

# Calculate posterior predictive probability with external control
BayesPostPredBinary(
  prob = 'predictive', design = 'external', theta0 = 0.5,
  n1 = 12, n2 = 15, y1 = 7, y2 = 7, a1 = 0.5, a2 = 0.5, b1 = 0.5, b2 = 0.5,
  m1 = 12, m2 = 12, ne1 = 12, ne2 = 12, ye1 = 6, ye2 = 6, ae1 = 0.5, ae2 = 0.5
)
#> [1] 0.02838203