6  Prior, Likelihood, Posterior

Chapter 2 asked one question of a two-group trial: could the difference we saw be produced by chance alone? The answer was a p-value, a number computed on the assumption that nothing is going on. A trialist usually wants the answer to a different question: given what we saw, how likely is it that the new treatment is better, and by how much? Bayesian inference uses Bayes’ rule to combine the data with a probability distribution describing knowledge of the effect before the trial, an input the traditional analysis omits.

The example from Chapter 2 has a control response rate of 30% and a treatment response rate of 45%. With a flat prior, the Bayesian and traditional analyses give nearly the same numbers.

ImportantRegulatory anchor

ICH E9, Statistical Principles for Clinical Trials (Step 4, February 1998) (International Council for Harmonisation 1998). Section 1.2 observes that clinical-trial methodology has been based on frequentist methods, then states that this “should not be taken to imply that other approaches are not appropriate: the use of Bayesian (see Glossary) and other approaches may be considered when the reasons for their use are clear and when the resulting conclusions are sufficiently robust.” The Glossary defines Bayesian approaches as those that provide “a posterior probability distribution for some parameter (e.g. treatment effect), derived from the observed data and a prior probability distribution for the parameter.” Section 5.5 asks for estimates of treatment effect with confidence intervals in addition to tests. E9 permits Bayesian analysis and asks for reasons and robustness; it does not forbid it.

ICH E20, Adaptive Designs for Clinical Trials (Step 2 draft, June 2025) (International Council for Harmonisation 2025). Section 5.3 describes Bayesian methods as those that “combine a prior probability distribution with current trial data to obtain a posterior probability distribution,” and expects Bayesian adaptive designs to show targeted operating characteristics, including control of the type I error probability where that is the objective. A draft, not binding.

FDA, Use of Bayesian Methodology in Clinical Trials of Drug and Biological Products (draft guidance, January 2026) (U.S. Food and Drug Administration 2026). Section II defines the prior as “the pre-study probability distribution for model parameters.” Section IV.B says “It is always critical for Bayesian analyses to have a prespecified prior.” A draft, not binding; Chapter 4 describes all three documents and their status.

6.1 Bayes’ rule, starting from a histogram

The rule is Bayes’s (1763) and Laplace’s, and it became a theory of decision with de Finetti and Savage (Savage 1954). Take a coin of unknown bias, and let \(\theta\) be the probability that it lands heads. To keep the arithmetic visible, allow \(\theta\) only the eleven values \(0, 0.1, 0.2, \ldots, 1\). The prior is a histogram over these values: one bar per value, the bars summing to one, each bar saying how plausible that value is before any toss. The prior in Figure 6.1 puts most of its weight near one half and none at 0 or 1. It is the \(\mathrm{Beta}(2,2)\) curve defined below, read off at the eleven values and rescaled.

The likelihood is a second histogram: for each value of \(\theta\), the probability of the tosses actually seen if that value were true. After 7 heads in 10 tosses it peaks at \(\theta = 0.7\). The likelihood bars do not sum to one, because they are probabilities of one fixed result under different values of \(\theta\), so the figure rescales them for display. The posterior is the third histogram: multiply the prior bar and the likelihood bar at every value, then divide each product by the sum of the eleven products so that the posterior sums to one. It says how plausible each value of \(\theta\) is after the tosses.

Show the R code
library(patchwork)
theta <- seq(0, 1, by = 0.1); prior <- dbeta(theta, 2, 2)
grid_row <- function(theta, prior, h, n, lab, w = 0.07) {
  g <- grid_update(theta, prior, dbinom(h, n, theta))
  bar <- function(y, t, ylab = NULL) ggplot(data.frame(theta, y), aes(theta, y)) + geom_col(fill = "#1B9E77", width = w) +
    scale_x_continuous(breaks = seq(0, 1, 0.2)) + labs(x = expression(theta), y = ylab, title = t) + theme_minimal(base_size = 9)
  sym <- function(s) ggplot() + annotate("text", 0, 0, label = s, size = 9) + theme_void()
  bar(g$prior, "Prior", lab) + sym("x") + bar(g$likelihood, "Likelihood") + sym("=") + bar(g$posterior, "Posterior") +
    plot_layout(widths = c(4, 0.7, 4, 0.7, 4))
}
grid_row(theta, prior, 7, 10, "7 of 10") / grid_row(theta, prior, 70, 100, "70 of 100")
Figure 6.1: Bayes’ rule on a grid of ten-percent steps for the coin, with the Beta(2, 2) prior. Top: 7 heads in 10 tosses. Bottom: 70 heads in 100 tosses. In each row the prior times the likelihood, each rescaled to sum to one, gives the posterior. The likelihood sharpens with more data and the prior’s influence fades.

Take the value \(\theta = 0.7\). The prior bar is the \(\mathrm{Beta}(2,2)\) density there, \(6 \times 0.7 \times 0.3 = 1.26\), rescaled so that the eleven bars sum to one: 0.127. The likelihood bar is the probability of 7 heads in 10 tosses at \(\theta = 0.7\), 0.267, rescaled the same way: 0.293. After the multiplication and the division the posterior bar at \(\theta = 0.7\) is 0.300. In the top row the prior still counts: it pulls the posterior toward one half, and the bar at 0.6 is nearly as tall as the bar at 0.7. In the bottom row, for the weak \(\mathrm{Beta}(2,2)\) prior shown here, the posterior is close to the normalized likelihood after 100 tosses. A more concentrated prior could still have substantial influence. The traditional estimate after 10 tosses is \(7/10 = 0.70\), with a standard error of about \(\sqrt{0.7 \times 0.3 / 10} = 0.145\). The posterior mean on the grid is 0.643, between the data and the prior’s center.

The same calculation for a patient response rate

A single-arm phase 2 trial treats 20 patients and 9 respond. Let \(\theta\) be the response rate of the new treatment. Historical patients responded about 30% of the time, so take a prior centered at 0.30 and worth about ten patients (the \(\mathrm{Beta}(3,7)\) curve), on a finer grid of 21 values in steps of 0.05.

Show the R code
theta2 <- seq(0, 1, by = 0.05); prior2 <- dbeta(theta2, 3, 7)
gr <- grid_update(theta2, prior2, dbinom(9, 20, theta2))
grid_row(theta2, prior2, 9, 20, NULL, w = 0.035)
Figure 6.2: Bayes’ rule on a grid of five-percent steps for a response rate: prior centered at 0.30, and 9 responders among 20 patients. The posterior lies between the prior center and the observed 45%.

The observed response rate is \(9/20 = 0.45\). The posterior mean is 0.400, which is the prior center 0.30 pulled toward the data, and the posterior probability that the response rate exceeds 30% is 0.80. That probability is the kind of statement a trialist wants and a p-value does not give. A finer grid draws the same picture with thinner bars along a smooth curve, and the next sections replace the grid by smooth curves for which the multiplication can be done on paper.

In symbols

For an unknown parameter \(\theta\) and data \(y\),

\[ \pi(\theta \mid y) = \frac{p(y \mid \theta)\, \pi(\theta)}{\int p(y \mid \theta')\, \pi(\theta')\, d\theta'} \;\propto\; p(y \mid \theta)\, \pi(\theta), \tag{6.1}\]

where \(\pi(\theta)\) is the prior, \(p(y \mid \theta)\) the likelihood and \(\pi(\theta \mid y)\) the posterior. The denominator is the probability of the data averaged over the prior. It does not depend on \(\theta\), so it only rescales the product to integrate to one (on the grid it is the sum of the products). The shape of the posterior is the prior times the likelihood.

The traditional analysis uses the same likelihood. A frequentist estimate, the maximum likelihood estimate, is the value of \(\theta\) at which \(p(y \mid \theta)\) peaks, and a z test is a calculation on its sampling distribution. What the Bayesian gives up is nothing mathematical, but something practical: the answer now depends on a choice, the prior, that has to be made, defended and written into the protocol. That is the subject of Chapter 9 and the reason the FDA draft recommends prespecifying the analysis prior.

A diagnostic test

The same reversal of conditioning explains a screening result. Suppose a test has sensitivity 90% (it is positive in 90% of people who have the disease) and specificity 95% (it is negative in 95% of people who do not), and the disease has prevalence 2% in the screened population. A patient tests positive. Sensitivity is a probability about the test given the disease. The question asks for the reverse, so write the joint probability of “disease and positive” in two ways and equate them:

\[ \mathbb{P}(D \mid +) \, \mathbb{P}(+) = \mathbb{P}(+ \mid D) \, \mathbb{P}(D), \qquad\text{so}\qquad \mathbb{P}(D \mid +) = \frac{\mathbb{P}(+ \mid D) \, \mathbb{P}(D)}{\mathbb{P}(+ \mid D) \, \mathbb{P}(D) + \mathbb{P}(+ \mid \bar D) \, \mathbb{P}(\bar D)}. \]

Here \(\mathbb{P}(D)\) is the prior, \(\mathbb{P}(+ \mid D)\) the likelihood and \(\mathbb{P}(D \mid +)\) the posterior.

Show the R code
sens <- 0.90; spec <- 0.95; prev <- 0.02
p_pos <- sens * prev + (1 - spec) * (1 - prev)
ppv <- sens * prev / p_pos
knitr::kable(data.frame(Quantity = c("P(positive)", "P(disease | positive)", "P(disease | negative)"),
                        Probability = c(p_pos, ppv, (1 - sens) * prev / (1 - p_pos))), digits = 4, align = "lr")
Table 6.1: Screening test with sensitivity 90%, specificity 95% and prevalence 2%: probability of a positive result, and probability of disease after a positive and after a negative result.
Quantity Probability
P(positive) 0.0670
P(disease | positive) 0.2687
P(disease | negative) 0.0021

A patient with a positive test has about a 27% chance of having the disease (the positive predictive value), not 90%. The test is good, but the disease is rare, so most positives come from the large healthy group. The only thing that changes in a trial is that the unknown is no longer “disease or not” but a continuous quantity, the response rate or the log hazard ratio, and the prior is a distribution over its possible values rather than a single prevalence.

6.2 Exchangeability and de Finetti, informally

A trial analysis nearly always begins with the sentence “patients’ outcomes are independent and identically distributed with response probability \(p\).” The sentence is a good model when \(\theta\) is treated as a fixed unknown constant: given \(\theta\), outcomes are independent. The Bayesian view adds a distribution for \(\theta\), and that addition changes what the model says about outcomes we have not yet seen.

Consider a thumbtack tossed repeatedly, with \(y_i = 1\) if it lands point up. If we knew the probability \(\theta\) of landing point up, the tosses would be independent: the first result would tell us nothing about the second. But we do not know \(\theta\). After 500 tosses with 499 point up, nobody believes the next toss is as uncertain as the first one was. So, once \(\theta\) is given a distribution and integrated out, the predictive distribution of the tosses is not independent; they are independent only given \(\theta\), and a given \(\theta\) is exactly what a trial does not have. The same applies to patients: ten consecutive responders in an arm tell us something about the next patient, because they tell us about the arm’s response rate.

What is plausible in place of independence is a weaker symmetry, exchangeability: the probability we assign to a set of outcomes does not depend on the order in which patients are listed. Eight tosses with four point up are equally probable in the order 1,0,1,0,1,0,1,0 and in the order 0,1,1,0,1,0,0,1. Independent and identically distributed outcomes are always exchangeable, but not conversely, and exchangeability makes no reference to a parameter at all. It is a statement about our beliefs concerning data not yet seen.

de Finetti’s representation theorem (de Finetti 1937) says what an exchangeable sequence of binary outcomes looks like. If any number of further outcomes could be added and the sequence stays exchangeable, then there exists a probability distribution \(\Pi\) on \([0,1]\) (the mixing distribution, which need not have a density) such that

\[ \mathbb{P}(y_1, \ldots, y_n) = \int_0^1 \prod_{i=1}^n \theta^{y_i} (1-\theta)^{1-y_i} \, d\Pi(\theta) . \tag{6.2}\]

Read it left to right: the joint probability of the data is a mixture, over the unknown response rate, of the independent-coin probabilities. The theorem does not assume a parameter and then a prior. It produces both from the single judgment of exchangeability. The parameter \(\theta\) is the limiting fraction of responders, and \(\Pi\) is our uncertainty about it.

  • The model “responses are Bernoulli(\(p\)) given \(p\)” and the prior on \(p\) come as a package. A protocol that specifies a likelihood without a prior has specified half of a Bayesian model; the traditional protocol specifies the likelihood half and handles the other half through the sampling distribution.
  • If patients enrolled in the first year are systematically different from those enrolled later, or the sites differ, the order does matter. Time trends, site effects and covariates are ways of relaxing exchangeability to “exchangeable within strata,” and the same judgment returns when we borrow information in Chapter 20.
  • Randomization (Chapter 3) makes treatment assignment independent of prognosis and potential outcomes. The response model separately assumes exchangeability within each arm, or within specified covariate strata.

6.3 From the grid to the Beta family

The prior-and-posterior module of the book’s companion online lab (https://vsokolov.org/bayesian_trials_lab/01-prior-posterior.html, described in the Preface) covers the same ideas with a coin. (In this and the following sections \(\theta\) is the success probability of a single arm, which the two-group sections call \(p_j\).)

The convenient family of priors for a probability is the Beta distribution, \(\theta \sim \mathrm{Beta}(a, b)\), with density proportional to \(\theta^{a-1}(1-\theta)^{b-1}\) on \([0,1]\). Its mean is \(a/(a+b)\). \(\mathrm{Beta}(1,1)\) is the flat distribution on \([0,1]\): every value of \(\theta\) is equally believable. \(\mathrm{Beta}(2,2)\) is a gentle bell centered at one half. Larger \(a\) and \(b\) give narrower bells.

Show the R code
gg <- seq(0, 1, length.out = 400)
bf <- data.frame(x = rep(gg, 4), y = c(dbeta(gg, 1, 1), dbeta(gg, 2, 2), dbeta(gg, 3, 7), dbeta(gg, 30, 70)),
                 prior = rep(c("Beta(1, 1)", "Beta(2, 2)", "Beta(3, 7)", "Beta(30, 70)"), each = 400))
bf$prior <- factor(bf$prior, unique(bf$prior))
ggplot(bf, aes(x, y, colour = prior)) + geom_line() + scale_colour_brewer(palette = "Dark2") +
  labs(x = expression(theta), y = "density", colour = NULL) + theme_minimal(base_size = 9)
Figure 6.3: Four Beta densities. Beta(1, 1) is flat, Beta(2, 2) is a gentle bell at one half, Beta(3, 7) is centered at 0.30 and is worth ten patients, and Beta(30, 70) is the same center worth one hundred patients.

The convenience is that the likelihood of \(h\) heads and \(t\) tails, \(\theta^{h}(1-\theta)^{t}\), has the same algebraic form as the Beta density. Multiplying them as in Equation 6.1 gives

\[ \theta \sim \mathrm{Beta}(a, b), \quad h \text{ heads}, \; t \text{ tails} \quad\Longrightarrow\quad \theta \mid y \sim \mathrm{Beta}(a + h,\; b + t). \tag{6.3}\]

A prior with this property, that the posterior belongs to the same family, is called conjugate to the likelihood. For the Beta prior and a binomial likelihood the update is addition: add the responders to \(a\) and the non-responders to \(b\). When \(a, b \ge 1\), \(\mathrm{Beta}(a,b)\) can be read as adding \(a-1\) responders and \(b-1\) non-responders to a flat \(\mathrm{Beta}(1,1)\) baseline (the convention that makes the rule exact is shown in the Technical note below). Shapes below one have no literal nonnegative patient-count interpretation under that convention.

Show the R code
post <- beta_post(7, 10, 2, 2) # prior Beta(2, 2), 7 heads in 10 tosses
flat <- beta_post(7, 10)
ecmo <- beta_post(11, 11) # 11 of 11 newborns survive on ECMO
summ <- function(label, f) data.frame(Scenario = label, Posterior = sprintf("Beta(%g, %g)", f$a, f$b), Mean = f$a / (f$a + f$b),
  Interval = sprintf("(%.3f, %.3f)", qbeta(0.025, f$a, f$b), qbeta(0.975, f$a, f$b)), Prob = pbeta(0.8, f$a, f$b, lower.tail = FALSE))
knitr::kable(rbind(summ("Coin, Beta(2, 2) prior", post), summ("Coin, flat prior", flat), summ("ECMO 11/11, flat prior", ecmo)),
             digits = 3, col.names = c("Scenario", "Posterior", "Posterior mean", "95% credible interval", "Pr(theta > 0.8)"), align = "llrrr")
Table 6.2: Beta posteriors for the coin (7 heads in 10 tosses) under a Beta(2, 2) prior and a flat prior, and for the ECMO trial (11 of 11 survivors) under a flat prior.
Scenario Posterior Posterior mean 95% credible interval Pr(theta > 0.8)
Coin, Beta(2, 2) prior Beta(9, 5) 0.643 (0.386, 0.861) 0.099
Coin, flat prior Beta(8, 4) 0.667 (0.390, 0.891) 0.161
ECMO 11/11, flat prior Beta(12, 1) 0.923 (0.735, 0.998) 0.931

As Table 6.2 shows, with the companion lab’s Beta(2,2) prior and 7 heads and 3 tails, the posterior is Beta(9,5) with mean \(9/14 = 0.643\). With the flat prior it is Beta(8,4) with mean \(0.667\). The traditional estimate 0.70 is the value at the peak of the likelihood; the Bayesian posterior mean sits between the data and the prior’s center, and by how much depends on the prior’s strength, which we quantify shortly.

Multiply the prior density by the binomial likelihood:

\[ \underbrace{\theta^{a-1}(1-\theta)^{b-1}}_{\text{prior}} \times \underbrace{\theta^{h}(1-\theta)^{t}}_{\text{likelihood}} = \theta^{a+h-1}(1-\theta)^{b+t-1}, \]

which is the kernel of \(\mathrm{Beta}(a+h, b+t)\). Dividing the kernel by \(B(a+h, b+t)\) gives its normalized density, so nothing needs to be integrated by hand. The denominator in Equation 6.1 is the prior predictive probability of the observed data. The statement “\(a - 1\) prior responders” holds because the flat \(\mathrm{Beta}(1,1)\) corresponds to none; some authors instead describe \(\mathrm{Beta}(a,b)\) as \(a+b\) pseudo-observations, which is the count used for effective sample size below. The two descriptions differ by the two pseudo-observations of the flat prior and are both in use.

The ECMO example is a real trial: Bartlett and colleagues’ 1985 trial of extracorporeal membrane oxygenation (ECMO) in newborns with respiratory failure (Bartlett et al. 1985). In the randomized play-the-winner design (outcomes so far change the probability that the next patient is assigned to each treatment), all 11 newborns assigned to ECMO survived (the single control patient did not). With a flat prior the posterior is \(\mathrm{Beta}(12, 1)\), which puts almost all its mass at survival rates near one; Table 6.2 gives \(\Pr(\theta > 0.8) = 0.931\).

6.4 Posterior mean as a weighted average, and the prior’s effective sample size

Let \(n = h + t\) be the number of patients and \(\hat p = h / n\) the observed proportion. Then

\[ \mathbb{E}[\theta \mid y] = \frac{a + h}{a + b + n} = \frac{a + b}{a + b + n} \cdot \frac{a}{a+b} + \frac{n}{a + b + n} \cdot \hat p . \tag{6.4}\]

It is a weighted average of the prior mean \(a/(a+b)\) and the sample proportion \(\hat p\), with weights proportional to \(a+b\) and \(n\). The prior acts as if it were a sample of size \(a + b\). This is the effective sample size (ESS) of a \(\mathrm{Beta}(a,b)\) prior: a flat \(\mathrm{Beta}(1,1)\) is worth two patients, a \(\mathrm{Beta}(2,2)\) four, a \(\mathrm{Beta}(30,70)\) one hundred. More refined definitions exist, which match the prior to the amount of information in the data under different criteria (Morita, Thall, and Müller 2008), and Chapter 9 treats them; for the Beta-binomial, \(a + b\) is the answer all of them roughly agree on. The prior of the BNT162b2 vaccine trial in Section 6.6, \(\mathrm{Beta}(0.700102, 1)\), has an ESS of 1.7 cases (the trial’s patients enter through the cases they produce): a prior of real shape and almost no weight.

A prior with an ESS of 10 in a trial of 200 contributes 5% of the weight; the same prior in a trial of 10 contributes half. As \(n\) grows, the data dominate and every reasonable prior gives nearly the same posterior. This is why Bayesian analysis of a large trial with a weak prior looks like the traditional analysis, and why the debate over priors matters most in small trials, rare diseases, pediatric extrapolation and anywhere a prior of substantial ESS is deliberately used to borrow information. The FDA draft’s warning (Section IV.B.2) that conclusions can depend strongly on the prior is a statement about exactly this weight (U.S. Food and Drug Administration 2026).

Show the R code
rows <- list()
for (pr in list(c(1, 1), c(3, 7), c(30, 70))) for (d in list(c(20, 9), c(100, 45), c(1000, 450))) {
  ess <- ess_beta(pr[1], pr[2]); n <- d[1]; h <- d[2]
  rows[[length(rows) + 1]] <- data.frame(Prior = sprintf("Beta(%g, %g)", pr[1], pr[2]), ESS = ess, n = n, w = ess / (ess + n),
                                         pm = (pr[1] + h) / (ess + n), sp = h / n)
}
knitr::kable(do.call(rbind, rows), digits = c(0, 0, 0, 3, 3, 3), align = "lrrrrr",
             col.names = c("Prior", "Prior ESS", "Patients n", "Weight on prior", "Posterior mean", "Sample proportion"))
Table 6.3: Weight of a Beta prior in the posterior mean for three priors and three trial sizes (45% observed response). Weight on prior is ESS/(ESS + n).
Prior Prior ESS Patients n Weight on prior Posterior mean Sample proportion
Beta(1, 1) 2 20 0.091 0.455 0.45
Beta(1, 1) 2 100 0.020 0.451 0.45
Beta(1, 1) 2 1000 0.002 0.450 0.45
Beta(3, 7) 10 20 0.333 0.400 0.45
Beta(3, 7) 10 100 0.091 0.436 0.45
Beta(3, 7) 10 1000 0.010 0.449 0.45
Beta(30, 70) 100 20 0.833 0.325 0.45
Beta(30, 70) 100 100 0.500 0.375 0.45
Beta(30, 70) 100 1000 0.091 0.436 0.45

For a prior centered at 0.30 with ESS 100 and a sample of 100 patients with a 45% response, the posterior mean is 0.375, halfway between the prior mean 0.30 and the sample proportion 0.45, because the prior and the data are worth the same number of patients. With 1,000 patients the same prior moves the posterior mean away from the sample proportion by less than 0.015.

6.5 Four operations for ulcer, one arm at a time

Novick and Grizzle (1965) made one of the first cases for Bayesian analysis of clinical trial data using a trial in progress that compared four operations for duodenal ulcer. The four operations remove increasing amounts of stomach: drainage and vagotomy, then 25 per cent resection with vagotomy, 50 per cent resection with vagotomy, and 75 per cent resection. The counts below are the dumping-syndrome data of Grizzle, Starmer and Koch (1969), pooled over four hospitals, as in Section 11.5. Dumping (rapid gastric emptying that causes nausea, cramps and sweating after meals) is an adverse effect, and it is more common the more stomach is removed. The counts ship with the package as the dataset ulcer.

Analyze each arm on its own. The prior for an arm’s dumping rate is \(\mathrm{Beta}(1, 1)\), uniform on (0, 1) and worth two patients, so that each arm’s roughly 100 patients dominate it, and by Equation 6.3 each posterior is \(\mathrm{Beta}(1 + \text{dumping},\; 1 + \text{patients without dumping})\).

Show the R code
ul <- ulcer; ul$op <- c("Drainage", "25% resection", "50% resection", "75% resection")
ul$a <- 1 + ul$dumping; ul$b <- 1 + ul$n - ul$dumping
knitr::kable(data.frame(ul$op, ul$n, ul$dumping, 100 * ul$dumping / ul$n, sprintf("Beta(%g, %g)", ul$a, ul$b), ul$a / (ul$a + ul$b),
  sprintf("(%.3f, %.3f)", qbeta(0.025, ul$a, ul$b), qbeta(0.975, ul$a, ul$b))), digits = c(0, 0, 0, 1, 0, 3, 0), align = "lrrrrrr",
  col.names = c("Operation", "Patients", "Dumping", "Observed rate (%)", "Posterior", "Posterior mean", "95% credible interval"))
Table 6.4: Dumping syndrome by operation (Grizzle, Starmer and Koch 1969): each operation analyzed on its own with a Beta(1, 1) prior on its dumping rate.
Operation Patients Dumping Observed rate (%) Posterior Posterior mean 95% credible interval
Drainage 96 35 36.5 Beta(36, 62) 0.367 (0.275, 0.465)
25% resection 104 36 34.6 Beta(37, 69) 0.349 (0.262, 0.442)
50% resection 110 52 47.3 Beta(53, 59) 0.473 (0.382, 0.566)
75% resection 107 54 50.5 Beta(55, 54) 0.505 (0.411, 0.598)
Show the R code
gg <- seq(0.2, 0.7, length.out = 400)
ud <- data.frame(x = rep(gg, 4), y = unlist(lapply(1:4, function(i) dbeta(gg, ul$a[i], ul$b[i]))), op = factor(rep(ul$op, each = 400), ul$op))
ggplot(ud, aes(x, y, colour = op)) + geom_line() + scale_colour_brewer(palette = "Dark2") +
  labs(x = "dumping rate", y = "density", colour = NULL) + theme_minimal(base_size = 9)
sup41 <- prob_superior(ul$a[4], ul$b[4], ul$a[1], ul$b[1])
Figure 6.4: Posterior distribution of the dumping rate for each of the four operations, each analyzed on its own with a Beta(1, 1) prior. The curves overlap because each arm has about 100 patients.

The dumping rate rises from 36.5% after drainage to 50.5% after 75 per cent resection, and the posterior means are shrunk slightly toward the prior’s 50%. Because the arms are analyzed separately, the posterior probability that 75 per cent resection has a higher dumping rate than drainage is 0.98. Each interval is wide, since each arm holds only about 100 patients. Whether the four arms should inform one another is the subject of Section 7.4.

6.6 A vaccine trial: BNT162b2

The phase 2/3 trial of the BNT162b2 mRNA vaccine is the regulatory example of this chapter. Its statistical analysis plan [Pfizer Inc. (2022), Section 7.1 and Appendix 2; the document at the cited ClinicalTrials.gov address is version 10, dated 7 October 2022, and is not an archived 2020 version] conditions on the total number of first COVID-19 cases \(s\), of whom \(s_1\) occur in the vaccine arm. With equal allocation and equal follow-up, a case falls in the vaccine arm with probability \(p = (1 - \mathrm{VE})/(2 - \mathrm{VE})\), where VE is the vaccine efficacy, one minus the ratio of incidence rates. Then \(s_1 \mid s \sim \mathrm{Binomial}(s, p)\), which is the Beta-binomial model with the cases playing the part of the tosses. The plan puts the prior \(p \sim \mathrm{Beta}(0.700102, 1)\) on \(p\). Its mean is \(0.4118\), the value of \(p\) at VE \(= 30\%\), and its effective sample size is \(a + b = 1.7\) cases, so it is centered on the efficacy margin and carries almost no weight.

The success criterion is a posterior probability: efficacy is declared if \(\Pr(\mathrm{VE} > 30\% \mid \text{data}) > 0.986\) at the final analysis, and if it exceeds \(0.995\) at an interim analysis. The plan states that the thresholds were calibrated so that the overall one-sided type I error is \(2.5\%\). The trial reported \(8\) cases with onset at least 7 days after the second dose in the vaccine group against \(162\) in the placebo group (Polack et al. 2020), so \(s = 170\) and \(s_1 = 8\), and the posterior is \(\mathrm{Beta}(0.700102 + 8,\; 1 + 162)\).

Show the R code
a0 <- 0.700102; b0 <- 1 # prior on p = (1 - VE) / (2 - VE)
ve <- function(p) (1 - 2 * p) / (1 - p) # VE as a function of p
post <- beta_post(8, 170, a0, b0) # 8 vaccine cases out of 170 (8 vs 162)
p30 <- 0.7 / 1.7 # p at VE = 30%
pr_fail <- pbeta(p30, post$a, post$b, lower.tail = FALSE) # Pr(VE < 30% | data)
q <- 100 * ve(qbeta(c(0.975, 0.5, 0.025), post$a, post$b)) # VE is decreasing in p
vv <- seq(0.001, 0.999, length.out = 600); pp <- (1 - vv) / (2 - vv) # density of VE by change of variable
vd <- data.frame(ve = rep(vv, 2), dens = c(dbeta(pp, a0, b0), dbeta(pp, post$a, post$b)) / (2 - vv)^2,
                 which = rep(c("prior", "posterior"), each = 600))
ggplot(vd, aes(ve, dens, colour = which)) + geom_line() + scale_colour_brewer(palette = "Dark2") +
  geom_area(data = subset(vd, which == "posterior" & ve >= q[1] / 100 & ve <= q[3] / 100), aes(ve, dens), inherit.aes = FALSE, fill = "#1B9E77", alpha = 0.3) +
  geom_vline(xintercept = 0.3, linetype = 2) + labs(x = "vaccine efficacy", y = "density", colour = NULL) + theme_minimal(base_size = 9)
Figure 6.5: BNT162b2: prior and posterior density of positive vaccine efficacy (VE), from the Beta-binomial model on the share of cases in the vaccine arm. The shaded region is the 95% credible interval. The success margin of 30% lies far to the left of the posterior.

The figure shows positive efficacy only; the prior assigns 38.4% probability to negative efficacy.

The posterior probability that VE exceeds 30% is \(1 - 2 \times 10^{-28}\), which clears \(0.986\) by a wide margin. The posterior median of VE is 94.9% with a 95% credible interval of 90.4% to 97.6%, against the published \(95.0\%\) with \(90.3\) to \(97.6\) (Polack et al. 2020). The small difference on the lower limit is likely due to the different surveillance time in the two arms, which this calculation ignores. With an effective sample size of 1.7 and 170 cases, the prior does not decide the result, and a flat prior would move the interval by well under a point.

6.7 One toxicity in six patients

In the traditional 3+3 dose-finding design, a dose is declared acceptable after at most one of six patients has a dose-limiting toxicity, a side effect severe enough to bar a higher dose. The toxicity rate at that dose is a probability and the Beta-binomial model applies: with a Jeffreys prior \(\mathrm{Beta}(0.5, 0.5)\) (a standard prior that favors neither low nor high rates) and 1 toxicity in 6 patients the posterior is \(\mathrm{Beta}(1.5, 5.5)\).

Show the R code
tp <- beta_post(1, 6, 0.5, 0.5); tq <- qbeta(c(0.025, 0.975), tp$a, tp$b); tf <- beta_post(1, 6); tqf <- qbeta(c(0.025, 0.975), tf$a, tf$b)
gg <- seq(0, 1, length.out = 500); td <- data.frame(x = gg, y = dbeta(gg, tp$a, tp$b))
ggplot(td, aes(x, y)) + geom_line(colour = "#1B9E77") + geom_area(data = subset(td, x >= tq[1] & x <= tq[2]), fill = "#1B9E77", alpha = 0.3) +
  labs(x = "toxicity rate", y = "density") + theme_minimal(base_size = 9)
Figure 6.6: Posterior density of the toxicity rate after 1 toxicity in 6 patients, with a Jeffreys Beta(0.5, 0.5) prior. The shaded region is the 95% credible interval.

The 95% credible interval for the toxicity rate runs from 0.02 to 0.56 (from 0.04 to 0.58 with a flat prior). Whatever the prior, the range is far too wide to call the dose safe, and Chapter 18 returns to dose-finding.

6.8 Gamma-Poisson for event rates

Many safety and recurrence outcomes are counts of events over follow-up time, such as infections, seizures or hospitalizations. They are summarized by a rate, the number of events per patient-year. Let \(\lambda\) be the rate and suppose the patients were followed for a total of \(T\) patient-years, with \(y\) events. The standard model is \(y \mid \lambda \sim \mathrm{Poisson}(\lambda T)\), so the likelihood is proportional to \(\lambda^{y} e^{-\lambda T}\). The conjugate prior is the gamma distribution, \(\lambda \sim \mathrm{Gamma}(a_G, b_G)\), with shape \(a_G\) and rate \(b_G\), density proportional to \(\lambda^{a_G - 1} e^{-b_G \lambda}\) on \(\lambda > 0\), mean \(a_G/b_G\), and \(b_G\) measured in patient-years. Multiplying the prior by the likelihood gives

\[ \lambda \sim \mathrm{Gamma}(a_G, b_G), \quad y \text{ events in } T \text{ patient-years} \quad\Longrightarrow\quad \lambda \mid y \sim \mathrm{Gamma}(a_G + y,\; b_G + T). \tag{6.5}\]

The update is again addition: events are added to \(a_G\) and patient-years to \(b_G\). The posterior mean \((a_G + y)/(b_G + T)\) is a weighted average of the prior mean \(a_G/b_G\) and the observed rate \(y/T\), with weights \(b_G\) and \(T\). The prior is worth \(b_G\) patient-years of follow-up, which is its effective sample size.

As an illustration (the numbers are invented for the purpose), suppose earlier studies of a drug suggest a rate of serious adverse events of about 0.10 per patient-year, worth 20 patient-years of experience, so the prior is \(\mathrm{Gamma}(2, 20)\). A new trial observes 9 events in 80 patient-years.

Show the R code
ga <- 2; gb <- 20; ge <- 9; gt <- 80
lam <- seq(0, 0.4, length.out = 400)
gd <- data.frame(x = rep(lam, 3), y = c(dgamma(lam, ga, gb), dgamma(lam, ge + 1, gt), dgamma(lam, ga + ge, gb + gt)),
                 which = factor(rep(c("prior", "likelihood", "posterior"), each = 400), c("prior", "likelihood", "posterior")))
ggplot(gd, aes(x, y, colour = which, linetype = which)) + geom_line() + scale_colour_brewer(palette = "Dark2") +
  scale_linetype_manual(values = c("dashed", "dotted", "solid")) + labs(x = "events per patient-year", y = "density", colour = NULL, linetype = NULL) + theme_minimal(base_size = 9)
Figure 6.7: Gamma-Poisson update for an adverse-event rate (illustrative numbers): Gamma(2, 20) prior, 9 events in 80 patient-years, and the posterior Gamma(11, 100). The likelihood is rescaled to have area one.

The observed rate is \(9/80 = 0.1125\). The posterior is \(\mathrm{Gamma}(11, 100)\) with mean 0.110, a 95% credible interval of 0.055 to 0.184, and a posterior probability of 0.12 that the rate exceeds 0.15 per patient-year. A safety rule of the form “stop if the posterior probability that the rate exceeds a limit is above a threshold” is a calculation of this kind, and Chapter 14 uses it for safety monitoring.

6.9 The two-group comparison, redone

Return to the trial of Chapter 2: a control arm with a true response probability \(p_0 = 0.30\), a treatment arm with \(p_1 = 0.45\), and suppose 100 patients per arm are randomized 1:1. For the worked numbers, let the trial come out at its design values: 30 of 100 control patients respond, and 45 of 100 treatment patients respond.

The traditional analysis

The observed difference is \(\hat p_1 - \hat p_0 = 0.15\). The pooled response is \(0.375\), the standard error of the difference under the null is \(\sqrt{0.375 \times 0.625 \times (1/100 + 1/100)} = 0.0685\), so \(z = 2.19\) and the one-sided p-value is \(0.014\). The one-sided p-value is below the usual 0.025 level. The 95% confidence interval for the difference, using the unpooled standard error 0.0676, runs from \(0.017\) to \(0.283\). Fisher’s exact test gives a one-sided p of \(0.020\).

The Bayesian analysis

Put an independent flat \(\mathrm{Beta}(1,1)\) prior on each arm’s response rate. By Equation 6.3 the posteriors are \(p_0 \mid y \sim \mathrm{Beta}(31, 71)\) and \(p_1 \mid y \sim \mathrm{Beta}(46, 56)\), independent. The quantity of interest is a function of both parameters, the difference \(p_1 - p_0\) or the event \(p_1 > p_0\). There is no neat formula for its distribution, but there does not need to be: draw many samples from each posterior and compute the quantity of interest on the pairs. This is Monte Carlo and it is how almost every Bayesian trial quantity in this book is computed.

Show the R code
x1 <- 45; x0 <- 30; n <- 100
z <- z_test_binary(x0, x1, n); p_one <- pnorm(z, lower.tail = FALSE) # traditional
ci <- wald_ci(x0, x1, n)

p1 <- beta_post(x1, n); p0 <- beta_post(x0, n) # Bayesian, flat Beta(1,1) priors
set.seed(2026)
diff <- rbeta(2e5, p1$a, p1$b) - rbeta(2e5, p0$a, p0$b)
sup <- function(m = 0) prob_superior(p1$a, p1$b, p0$a, p0$b, margin = m)
knitr::kable(data.frame(Quantity = c("z statistic", "One-sided p-value", "1 - p", "Difference in response rates", "95% confidence interval", "Posterior mean difference",
    "Pr(p1 > p0 | data), exact", "Pr(p1 > p0 | data), Monte Carlo", "Pr(difference > 0.05 | data)", "Pr(difference > 0.10 | data)", "95% credible interval"),
  Value = c(sprintf("%.2f", z), sprintf("%.4f", p_one), sprintf("%.4f", 1 - p_one), sprintf("%.2f", (x1 - x0) / n), sprintf("(%.3f, %.3f)", ci$lower, ci$upper),
    sprintf("%.3f", mean(diff)), sprintf("%.4f", sup()), sprintf("%.4f", mean(diff > 0)), sprintf("%.4f", sup(0.05)), sprintf("%.4f", sup(0.10)),
    sprintf("(%.3f, %.3f)", quantile(diff, 0.025), quantile(diff, 0.975)))), align = "lr")
Table 6.5: The running trial (30/100 control and 45/100 treatment responders): traditional z test and confidence interval, and the Bayesian analysis with flat Beta(1,1) priors on each arm.
Quantity Value
z statistic 2.19
One-sided p-value 0.0142
1 - p 0.9858
Difference in response rates 0.15
95% confidence interval (0.017, 0.283)
Posterior mean difference 0.147
Pr(p1 > p0 | data), exact 0.9855
Pr(p1 > p0 | data), Monte Carlo 0.9853
Pr(difference > 0.05 | data) 0.9259
Pr(difference > 0.10 | data) 0.7600
95% credible interval (0.015, 0.277)
Show the R code
library(patchwork)
grid <- seq(0, 1, length.out = 500)
dens <- data.frame(x = rep(grid, 2), y = c(dbeta(grid, 31, 71), dbeta(grid, 46, 56)),
                   arm = rep(c("control, Beta(31, 71)", "treatment, Beta(46, 56)"), each = 500))
g1 <- ggplot(dens, aes(x, y, colour = arm)) + geom_line() + scale_colour_brewer(palette = "Dark2") +
  labs(x = "response probability", y = NULL, colour = NULL) + theme_minimal(base_size = 9) +
  theme(axis.text.y = element_blank(), legend.position = "bottom")
g2 <- ggplot(data.frame(d = diff), aes(d)) + geom_histogram(aes(y = after_stat(density), fill = after_stat(x > 0)), binwidth = 0.005, boundary = 0) +
  geom_vline(xintercept = 0) + scale_fill_manual(values = c("grey70", "#1B9E77"), guide = "none") +
  labs(x = "p1 - p0", y = NULL) + theme_minimal(base_size = 9) + theme(axis.text.y = element_blank())
g1 + g2
Figure 6.8: Posterior distributions after 30/100 and 45/100 responders with flat priors (left), and the posterior of the difference p1 - p0 (right). The shaded area to the right of zero is Pr(p1 > p0 | data).

The posterior probability that the treatment’s response rate exceeds the control’s is \(\Pr(p_1 > p_0 \mid y)\) = 0.9855 (Table 6.5, Figure 6.8; numerical integration; the Monte Carlo estimate with 200,000 draws is within 0.001 of it). The one-sided p-value is 0.0142, and one minus it is 0.9858. The two numbers are close because in this problem they are nearly the same calculation, as the next section shows.

The posterior probability that the effect exceeds 5 percentage points is 0.926; that it exceeds 10 points is 0.760. These are the quantities that enter a success criterion of the form \(\Pr(\delta > a \mid \text{data}) > c\) used in the FDA draft (Section IV.A), where \(a\) is the smallest benefit worth having and \(c\) is a pre-specified probability. Chapter 8 treats such criteria, and Chapter 15 shows how \(c\) is chosen so the design has the type I error the regulator expects. Two real trials in Section 6.17 used this form: the BNT162b2 vaccine trial (success if \(\Pr(\mathrm{VE} > 30\%) > 0.986\), where VE is vaccine efficacy, at the final analysis) and REMAP-CAP (efficacy if the posterior probability of benefit exceeds 99%).

A side-by-side

Table 6.6: Same trial (30/100 control and 45/100 treatment responders), analyzed the traditional way and the Bayesian way with flat priors.
Traditional Bayesian (flat prior)
Unknown \(p_1 - p_0\), a fixed number \(p_1 - p_0\), described by a distribution
Input likelihood likelihood and prior
Main output estimate, 95% CI, one-sided p posterior distribution, credible interval, \(\Pr(p_1 > p_0 \mid y)\)
Probability statement is about the procedure, over repeated trials the parameter, given these data
Result here \(\hat d = 0.15\), CI (0.017, 0.283), \(p = 0.014\) mean 0.147, 95% CrI (0.015, 0.277), \(\Pr = 0.9855\)
Decision rule reject if \(p < 0.025\) declare success if \(\Pr(\delta > a \mid y) > c\)
What the regulator asks for prespecified test, \(\alpha\) control prespecified prior and \((a, c)\), calibrated operating characteristics

6.10 Why the two nearly agree

With a flat prior, the posterior of \(p_1 - p_0\) is centered, approximately, at the observed difference \(\hat d\) with standard deviation approximately equal to its standard error \(s\), and approximately normal (this is the Bernstein-von Mises phenomenon: with enough data the posterior looks like the normalized likelihood). So

\[ \Pr(p_1 - p_0 > 0 \mid y) \approx \Phi\!\left(\frac{\hat d}{s}\right) = 1 - \Phi\!\left(-\frac{\hat d}{s}\right). \]

The one-sided p-value for testing \(H_0: p_1 \le p_0\) is \(1 - \Phi(\hat d / s_0)\), with \(s_0\) the standard error under the null. If \(s \approx s_0\) the p-value is \(1 - \Phi(\hat d / s)\), and so \(1 - p \approx \Phi(\hat d/s)\). The two expressions are the same up to which standard error (pooled or unpooled) is used and the slight skewness of the Beta. The match is not a theorem of the model; it is a property of a flat prior and a nearly normal likelihood, and it fails when the prior is informative, when the sample is small or when the response rates are near 0 or 1.

Across 500 simulated trials with 100 patients per arm and true rates 0.45 and 0.30, the largest gap between \(1 - p\) and the flat-prior posterior probability (computed exactly) is 0.002, and the average gap is 0.0005.

Numerical agreement does not imply logical equivalence: the p-value is a statement about the data under the null, and \(\Pr(p_1 > p_0 \mid y)\) is a statement about the parameter given the data. A reader who says “\(1-p\) is the probability that the drug works” is correct in this one setting only because the prior is flat, which is itself a strong choice (it gives a prior probability of one half to the claim that treatment is better, and puts substantial mass on differences nobody believes). A trial that declares success when \(\Pr(p_1 > p_0 \mid y) > 0.975\) with a flat prior is, to a good approximation, the trial that declares success when the one-sided p-value is below 0.025. The Bayesian design’s savings, to be shown in later chapters, come from monitoring, multiple arms and prior information, not from a lower threshold at a single final analysis. Change the prior and the two diverge (Table 6.7):

Show the R code
priors <- list("flat Beta(1,1)" = c(1, 1), "Jeffreys Beta(.5,.5)" = c(0.5, 0.5), "skeptical Beta(3,7), ESS 10" = c(3, 7))
pp <- sapply(priors, function(ab) prob_superior(ab[1] + 45, ab[2] + 55, ab[1] + 30, ab[2] + 70))
knitr::kable(data.frame(Prior = names(priors), P = unname(pp)), digits = 3, col.names = c("Prior on each arm", "Pr(p1 > p0 | data)"), align = "lr")
Table 6.7: Posterior probability that the treatment is better than control for the running trial (45/100 against 30/100), under three priors applied to both arms.
Prior on each arm Pr(p1 > p0 | data)
flat Beta(1,1) 0.985
Jeffreys Beta(.5,.5) 0.986
skeptical Beta(3,7), ESS 10 0.983

Applied to both arms alike, even the skeptical Beta(3,7) prior (ESS 10, mean 0.30) moves the answer only from 0.9855 to about 0.983, because 100 patients per arm swamp the 10 pseudo-patients the prior contributes to each arm and the prior is the same on both arms. A prior that differs between arms, or one that centers the treatment effect at zero, is a different matter and is treated in Chapter 9.

6.11 Credible intervals and confidence intervals

The 95% confidence interval for the difference is (0.017, 0.283). The 95% credible interval, the central 95% of the posterior of \(p_1 - p_0\), is (0.015, 0.277).

A confidence interval is a procedure. If the trial were repeated many times and the interval computed each time by the same recipe, about 95% of the intervals would contain the true \(p_1 - p_0\) (this is the nominal coverage of the normal-approximation recipe, which holds approximately and under suitable conditions). The probability statement is about the procedure; for the one interval reported in the clinical study report, the true value is either inside or it is not, and the “95%” does not say how likely it is that this interval covers the truth. A credible interval is a statement about the parameter: given the data and the prior, the probability that \(p_1 - p_0\) lies in the interval is 95%. There is also a choice of which 95% region, and two are common: the equal-tailed interval, leaving 2.5% in each tail, and the highest posterior density (HPD) interval, the shortest region with 95% probability. For a skewed posterior they differ; for the symmetrical one above they nearly coincide.

An informative prior can shift the credible interval, and often narrows it, without affecting the confidence interval. For a single response probability, a Wald interval can extend outside \([0,1]\) or cover poorly near the boundaries, whereas a credible interval built from the Beta posterior stays inside by construction. The following simulation examines coverage for this single probability.

Show the R code
set.seed(11); N <- 20000; n <- 100
cover <- function(x, p) { # coverage of Wald and flat-prior credible intervals
  ph <- x / n; s <- sqrt(ph * (1 - ph) / n)
  lo <- qbeta(0.025, 1 + x, 1 + n - x); hi <- qbeta(0.975, 1 + x, 1 + n - x)
  c(wald = mean(abs(ph - p) < 1.96 * s), credible = mean(lo < p & p < hi))
}
rows <- NULL
for (p in c(0.05, 0.30, 0.50)) {
  cv <- cover(rbinom(N, n, p), p)
  rows <- rbind(rows, data.frame(Truth = sprintf("fixed p = %.2f", p), wald = cv[["wald"]], cred = cv[["credible"]]))
}
p <- rbeta(N, 1, 1) # Bayesian calibration: truth drawn from the prior
rows <- rbind(rows, data.frame(Truth = "p drawn from Beta(1,1)", wald = NA, cred = cover(rbinom(N, n, p), p)[["credible"]]))
options(knitr.kable.NA = "")
knitr::kable(rows, digits = 3, col.names = c("True response rate", "Wald interval", "Flat-prior credible interval"), align = "lrr")
Table 6.8: Coverage of the Wald 95% confidence interval and the flat-prior 95% credible interval with n = 100: at fixed true response rates, and averaged over true rates drawn from the Beta(1,1) prior (20,000 simulated trials per row).
True response rate Wald interval Flat-prior credible interval
fixed p = 0.05 0.880 0.964
fixed p = 0.30 0.953 0.952
fixed p = 0.50 0.944 0.944
p drawn from Beta(1,1) 0.949

At a fixed true rate of 0.30 or 0.50, both intervals cover 94% to 95% of the time. At a rate of 0.05 the Wald interval covers only 88%, while the flat-prior credible interval covers 96.4%. Averaged over draws of \(p\) from the prior, the credible interval covers 95% by construction (94.9% in the run): if the prior is a faithful description of where true rates come from, the 95% is exact, and that is the Bayesian sense of calibration. If the prior is wrong, the coverage at a specific \(p\) can be off, which is why the FDA draft asks for operating characteristics under a range of scenarios.

6.12 The posterior predictive distribution

Decisions depend on what will happen next: how many of the next 50 patients will respond, how likely it is that the trial, if continued to its planned size, will end in success. The Bayesian answer is the posterior predictive distribution, the distribution of future data after averaging over the uncertainty about the parameter:

\[ p(\tilde y \mid y) = \int p(\tilde y \mid \theta)\, \pi(\theta \mid y)\, d\theta . \tag{6.6}\]

For a Beta posterior \(\mathrm{Beta}(a', b')\) and \(m\) future patients, the number of future responders follows a beta-binomial distribution, which has a closed form, and its mean is \(m a' / (a' + b')\) (the posterior mean times \(m\)). The traditional analogue is a prediction interval, or more often a plug-in calculation: assume \(p = \hat p\) and compute a binomial. The plug-in ignores the uncertainty in \(\hat p\) and is therefore too narrow.

Show the R code
a <- 46; b <- 56; m <- 50; k <- 0:m # treatment-arm posterior after 45/100, next 50 patients
pred <- dbetabinom(k, m, a, b) # beta-binomial pmf
plug <- dbinom(k, m, 0.45)
mom <- function(pm) c(mean = sum(k * pm), sd = sqrt(sum(k^2 * pm) - sum(k * pm)^2))
int <- function(pm) k[c(which(cumsum(pm) >= 0.025)[1], which(cumsum(pm) >= 0.975)[1])]
draws <- rbinom(2e5, m, rbeta(2e5, a, b)) # Monte Carlo check: parameter first, then data
mp <- mom(pred); mq <- mom(plug); ip <- int(pred); iq <- int(plug)
knitr::kable(data.frame(Method = c("Posterior predictive (beta-binomial)", "Plug-in binomial, p = 0.45", "Monte Carlo check"),
  Mean = c(mp[[1]], mq[[1]], mean(draws)), SD = c(mp[[2]], mq[[2]], sd(draws)),
  Lower = c(ip[1], iq[1], unname(quantile(draws, 0.025))), Upper = c(ip[2], iq[2], unname(quantile(draws, 0.975)))),
  digits = c(0, 2, 2, 0, 0), col.names = c("Method", "Mean", "SD", "95% interval, lower", "95% interval, upper"), align = "lrrrr")
Table 6.9: Number of responders among the next 50 patients, given 45/100 so far and a flat prior: posterior predictive distribution against the plug-in binomial with p = 0.45.
Method Mean SD 95% interval, lower 95% interval, upper
Posterior predictive (beta-binomial) 22.55 4.27 14 31
Plug-in binomial, p = 0.45 22.50 3.52 16 29
Monte Carlo check 22.56 4.28 14 31

In Table 6.9 the predictive mean is 22.5 responders out of 50 and its standard deviation is 4.27, against 3.52 for the plug-in binomial. The extra spread is the contribution of not knowing \(p\): the predictive standard deviation is 22% larger than the plug-in standard deviation. The 95% predictive interval for responders among the next 50 is 14 to 31, which the Monte Carlo agrees with.

The same two-stage logic, “draw the parameter from its posterior, then draw the future data from the model,” gives the predictive probability that a trial in progress will succeed at its final analysis. Chapter 16 builds on Equation 6.6 to define predictive probability, futility rules and Goldilocks-type sample-size choices (the sample size is picked from predictive probabilities).

6.13 Normal-normal: shrinkage toward a prior mean

A football season shows the arithmetic with a normal curve in place of a Beta. The Chicago Bears of 2014 had played nine games, and their results, in points scored minus points allowed, were \(-3, 8, 8, -21, -7, 14, -13, -28, -41\). Let \(\mu\) be the team’s true average margin. The nine games have mean -9.22 and standard deviation 18.34, and the standard deviation of one game, \(\sigma\), is taken from them and treated as known. The mean of \(n\) games then has standard error \(\sigma/\sqrt{n}\), which is 6.11 points for \(n = 9\).

Before the season, a team of unknown strength is expected to be average, so take the prior \(\mu \sim N(0, \tau^2)\) with \(\tau = 4\) points: the true average margin is probably within a touchdown of zero. A normal prior with a normal likelihood gives a normal posterior whose mean is a weighted average of the prior mean (zero) and the observed mean \(\bar y\). The weight on the data is the data precision divided by the total precision, where precision is the reciprocal of a variance. The data have precision \(n/\sigma^2\) and the prior has precision \(1/\tau^2\), so

\[ w = \frac{n/\sigma^2}{n/\sigma^2 + 1/\tau^2} = \frac{\tau^2}{\tau^2 + \sigma^2/n}, \qquad \mathbb{E}[\mu \mid \bar y] = w\,\bar y . \]

Show the R code
n_b <- length(bears); s2_b <- var(bears) / n_b # variance of the mean of the games
tau_b <- 4; w_b <- tau_b^2 / (tau_b^2 + s2_b)
tt <- seq(0.1, 25, length.out = 300)
ggplot(data.frame(tau = tt, w = tt^2 / (tt^2 + s2_b)), aes(tau, w)) + geom_line(colour = "#1B9E77") +
  geom_point(data = data.frame(tau = tau_b, w = w_b), size = 2.5, colour = "#D95F02") +
  labs(x = expression(tau ~ "(points)"), y = "weight on the data") + theme_minimal(base_size = 9)
Figure 6.9: Weight that the nine Bears games receive in the posterior mean, as a function of the prior standard deviation tau. The dot marks tau = 4 points, where the weight is 0.30.

With \(\tau = 4\) the weight on the data is \(w = 0.30\), so the posterior mean is \(0.30 \times (-9.22) = -2.76\) points. After nine games the data say the team is 9.2 points worse than average, and the posterior says 2.8 points worse, because nine games with a standard deviation of 18 points are a noisy record. The betting market can be compared with this posterior mean. For the next game, at home against the Minnesota Vikings, the betting lines reported for the game had the Bears favored by about 3 points (one sportsbook posted Bears -3.5 at publication). With the usual home-field advantage of about 3 points, that rates the Bears about even with the Vikings on a neutral field. That is a statement about Chicago relative to Minnesota, not relative to an average team. The posterior with \(\tau = 4\) rates the Bears 2.76 points worse than average. The two comparisons are against different opponents (the Vikings and an average team), so they are not compared further here. The normal model also gives every game the same weight, so it does not single out the two blowouts. The Bears won the game, 21 to 13.

The prior standard deviation \(\tau\) is the knob. A small \(\tau\) means the prior is precise and the posterior is pulled strongly toward the prior mean, and as \(\tau\) grows the weight on the data rises toward one (Figure 6.9). With \(\tau = 10\) the data get a weight of 0.73, and with \(\tau = 2\) only 0.10.

Many pivotal trials, in oncology, cardiovascular disease and neurology, do not have a binary endpoint but a time to event, and the treatment effect is a hazard ratio (HR). The Beta-binomial model does not apply. The normal-normal model, which does apply, rests on a standard approximation.

For 1:1 randomization with \(d\) total events, the log hazard ratio estimate has standard error \(\approx 2/\sqrt{d}\). (Each arm contributes about \(d/2\) events and the variance of a log hazard ratio is about \(1/d_1 + 1/d_0 = 4/d\).) With \(\theta = -\log \mathrm{HR}\), so that a positive \(\theta\) means benefit, the data are summarized by

\[ \hat\theta \mid \theta \;\sim\; N\!\left(\theta,\; \frac{4}{d}\right). \tag{6.7}\]

This is the likelihood, an approximate one: the Cox partial likelihood in large samples is close to a normal in \(\theta\), and the approximation is the standard route taken by Bayesian design in survival studies. In the traditional trial the logrank test is, to a good approximation, the z test \(z = \hat\theta \sqrt{d} / 2\), and the one-sided p-value is \(1 - \Phi(z)\). The number of events, not patients, is the sample size, in both frameworks, as in Chapter 10 and Chapter 12.

Take a trial that observes \(d = 200\) events and \(\widehat{\mathrm{HR}} = 0.74\), so \(\hat\theta = -\log 0.74 = 0.301\) with standard error \(2/\sqrt{200} = 0.141\). Then \(z = 2.13\) and the one-sided p-value is \(0.017\), a success at the 0.025 level.

For the prior take a normal distribution, \(\theta \sim N(m_0, \tau^2)\). A normal prior and a normal likelihood give a normal posterior (normal-normal conjugacy), with precision (the reciprocal of the variance) equal to the sum of the precisions:

\[ \theta \mid \hat\theta \;\sim\; N\!\left(m_1, s_1^2\right), \quad \frac{1}{s_1^2} = \frac{1}{\tau^2} + \frac{d}{4}, \quad m_1 = \frac{m_0/\tau^2 + \hat\theta\, d/4}{1/\tau^2 + d/4}. \tag{6.8}\]

This is the same weighted average of Equation 6.4, now with weights given by precision. The data have precision \(d/4\), so each event carries a quarter of a unit of precision, and a prior of variance \(\tau^2\) carries \(1/\tau^2\). The effective sample size of the prior, in events, is therefore \(4/\tau^2\): a prior \(N(0, 0.2^2)\) is worth 100 events, and \(N(0, 0.35^2)\) is worth about 33.

Show the R code
d <- 200; theta_hat <- -log(0.74); se <- 2 / sqrt(d)
margin <- log(1 / 0.9) # effect margin a: HR below 0.9
z <- theta_hat / se
priors <- c("approximately flat N(0, 10^2)" = 10, "skeptical N(0, 0.35^2)" = 0.35, "strong skeptical N(0, 0.20^2)" = 0.20)
tab <- do.call(rbind, lapply(names(priors), function(nm) {
  s0 <- priors[[nm]]; u <- normal_update(0, s0, theta_hat, se)
  ci <- exp(-(u$mean + c(1, -1) * 1.96 * u$sd))
  data.frame(nm, 4 / s0^2, u$mean, exp(-u$mean), pnorm(0, u$mean, u$sd, lower.tail = FALSE),
             pnorm(margin, u$mean, u$sd, lower.tail = FALSE), sprintf("%.2f to %.2f", ci[1], ci[2]))
}))
knitr::kable(tab, digits = c(0, 0, 3, 2, 3, 3, 0), align = "lrrrrrr",
  col.names = c("Prior", "Prior ESS (events)", "Posterior mean", "Posterior median HR", "Pr(theta > 0)", "Pr(HR < 0.9)", "95% credible interval for HR"))
Table 6.10: Posterior for theta = -log HR with 200 events and an observed hazard ratio of 0.74, under a flat, a skeptical and a strong skeptical normal prior. Pr(HR < 0.9) is the posterior probability that the hazard ratio is below the margin 0.9.
Prior Prior ESS (events) Posterior mean Posterior median HR Pr(theta > 0) Pr(HR < 0.9) 95% credible interval for HR
approximately flat N(0, 10^2) 0 0.301 0.74 0.983 0.917 0.56 to 0.98
skeptical N(0, 0.35^2) 33 0.259 0.77 0.976 0.879 0.60 to 1.00
strong skeptical N(0, 0.20^2) 100 0.201 0.82 0.959 0.796 0.65 to 1.03
Show the R code
u <- normal_update(0, 0.35, theta_hat, se)
ggplot(data.frame(x = c(-0.4, 0.8)), aes(x)) +
  stat_function(fun = dnorm, args = list(0, 0.35), aes(colour = "skeptical prior"), linetype = "dashed") +
  stat_function(fun = dnorm, args = list(theta_hat, se), aes(colour = "likelihood"), linetype = "dotted") +
  stat_function(fun = dnorm, args = list(u$mean, u$sd), aes(colour = "posterior")) +
  geom_vline(xintercept = 0) + scale_colour_brewer(palette = "Dark2") +
  labs(x = expression(theta == -log~HR), y = NULL, colour = NULL) + theme_minimal(base_size = 9) +
  theme(axis.text.y = element_blank())
Figure 6.10: Prior, likelihood and posterior for theta = -log HR with 200 events and an observed hazard ratio of 0.74. The skeptical prior N(0, 0.35^2) pulls the posterior toward no effect.

With a flat prior, the posterior is \(N(0.301, 0.141^2)\) and \(\Pr(\theta > 0 \mid \hat\theta) = 0.983\). That is \(1 - p\) again (\(1 - 0.017 = 0.983\)), and now essentially exactly: with an improper flat prior (the limit of a normal prior as its variance grows), in the normal-normal model \(\Pr(\theta > 0 \mid \hat\theta) = \Phi(\hat\theta/\text{se})\) is identically one minus the one-sided p-value. With a skeptical prior of ESS 33 events (Figure 6.10), the posterior mean is 0.259 (HR 0.77), \(\Pr(\theta > 0) = 0.976\) and the 95% credible interval for the hazard ratio is 0.60 to 1.00. With the stronger skeptical prior (ESS 100) the posterior mean drops to 0.201 (HR 0.82) and the posterior probability of any benefit falls to 0.959. The same data under three priors give 0.983, 0.976 and 0.959: at a threshold of 0.975 the first two pass and the third fails. This is why the prior must be specified before the data, and why Chapter 9 is about how to choose one that a regulator will accept. The prior standard deviation of the log hazard ratio is the same knob as \(\tau\) for the Bears, and the skeptical-prior \(\tau\) in Section 22.2.2 is chosen in the same way. A later chapter uses this weighting to pool groups.

Complete the square. The product of \(\exp\{-(\theta - m_0)^2 / 2\tau^2\}\) and \(\exp\{-(\hat\theta - \theta)^2 d/8\}\) is proportional to \(\exp\{-\tfrac12(1/\tau^2 + d/4)\,\theta^2 + (m_0/\tau^2 + \hat\theta\, d/4)\,\theta\}\), which is the kernel of a normal with precision \(1/\tau^2 + d/4\) and mean the ratio of the linear to the quadratic coefficient. The approximation in Equation 6.7 is a modeling choice, not an exact result: it treats \(\hat\theta\) as sufficient for the log hazard ratio, which holds only approximately for a Cox model, and it ignores the discreteness of event times. For design purposes it is the usual choice; the final analysis in a Bayesian trial that wants the exact partial or full likelihood can use a piecewise exponential model.

6.14 When no pair fits

The Beta with a binomial, the gamma with a Poisson and the normal with a normal are pairs for which the posterior has a closed form, and the update is addition. Most models used in trials are not so lucky. A logistic regression that adjusts the treatment effect for baseline covariates, a proportional-odds model for an ordinal outcome such as the organ support-free days of REMAP-CAP, and a model with many arms or time trends have prior-times-likelihood products that match no standard distribution.

In these models the posterior is still defined by Equation 6.1. What is missing is the formula, so the posterior is computed numerically, by integration, approximation or simulation. The most common general method is simulation. Markov chain Monte Carlo (MCMC) generates a long sequence of draws of the parameters, each draw depending only on the previous one, constructed so that its stationary distribution is the posterior. After a warm-up, the dependent draws approximate the posterior if the chain has explored it adequately; convergence diagnostics and Monte Carlo error assess that approximation. Any summary then comes from the draws, as in the two-group comparison above: the mean of the draws is the posterior mean, their 2.5% and 97.5% quantiles are the credible interval, and the share of draws in which the odds ratio exceeds one is the posterior probability of benefit.

The computation is done by software such as Stan, and the analyst does not code the sampler. The analyst does have to check that the chains have converged, that the number of effective draws is large enough for the summary reported, and that the result does not move with the seed. A protocol for a model without a closed form therefore states the software, the number of chains and draws, the seed and the convergence checks, as in Section 6.16. Nothing else in the logic changes: the prior, the likelihood and the posterior are the same objects as on the grid at the start of this chapter.

6.15 Sequential updating: the posterior today is the prior tomorrow

Suppose data arrive in batches, \(y_1\) and then \(y_2\). Bayes’ rule can be applied twice: first to the prior and \(y_1\), giving \(\pi(\theta \mid y_1)\), then to \(\pi(\theta \mid y_1)\) taken as the prior and \(y_2\):

\[ \pi(\theta \mid y_1, y_2) \;\propto\; p(y_2 \mid \theta)\, \pi(\theta \mid y_1) \;\propto\; p(y_2 \mid \theta)\, p(y_1 \mid \theta)\, \pi(\theta), \tag{6.9}\]

provided \(y_1\) and \(y_2\) are conditionally independent given \(\theta\) (which is what exchangeability delivers). The last expression is the posterior obtained from all data at once with the original prior. Updating in batches, one patient at a time or all at once, gives the same posterior, and the path by which the data arrived does not matter.

Show the R code
r <- c(11, 9, 14, 11); m <- rep(25, 4) # responders and patients per batch, total 45/100
a <- 1; b <- 1; grid <- seq(0, 1, length.out = 500)
curves <- data.frame(x = grid, y = dbeta(grid, a, b), stage = "prior")
for (k in 1:4) {
  a <- a + r[k]; b <- b + m[k] - r[k]
  curves <- rbind(curves, data.frame(x = grid, y = dbeta(grid, a, b), stage = paste("after", 25 * k)))
}
stopifnot(a == 1 + sum(r), b == 1 + 100 - sum(r)) # same as the one-step update with all 100
curves$stage <- factor(curves$stage, unique(curves$stage))
ggplot(curves, aes(x, y, colour = stage)) + geom_line() + scale_colour_brewer(palette = "Dark2") +
  labs(x = "treatment response probability", y = NULL, colour = NULL) + theme_minimal(base_size = 9) +
  theme(axis.text.y = element_blank())
Figure 6.11: Posterior of the treatment response rate as 100 patients accrue in four batches of 25, starting from a flat prior. The last curve is also the posterior from all 100 patients at once.

The check at the end of the code above (and the last curve of Figure 6.11) shows that the four-step posterior is \(\mathrm{Beta}(46, 56)\), the same as the one-step posterior of Section 6.9. For conjugate models the batch-wise update is just a running total of responders and non-responders, which is why Bayesian interim analyses are cheap computationally: the interim posterior is a handful of arithmetic operations, and a Data Monitoring Committee can be given it at any time.

Looking does not change the posterior

In a group sequential design (the subject of Chapter 12) every look at the data costs something: the nominal level at each look is reduced, because testing five times at 0.025 does not preserve a type I error of 0.025. Yet the Bayesian posterior at any interim analysis is computed with exactly the same formula as the posterior at the end, and it does not know how many looks preceded it.

The likelihood principle says that, given the data, the evidence about \(\theta\) in an experiment depends on the data only through the likelihood function, and not on the stopping rule or on what other results might have been observed but were not (Berger and Wolpert 1988). So the posterior is unchanged by the decision to look, or by the decision to stop because the posterior crossed a threshold. A p-value, by contrast, is a statement about all the data sets the procedure could have produced, and which data sets those are depends on the stopping rule: “stop at the first of five looks where \(z > 1.96\)” is a different procedure from “analyze once at the end,” and has a different sampling distribution. The type I error rate is a property of the procedure over repeated trials under the null, so it is changed by looking. The posterior probability, a statement about this trial’s parameter given this trial’s data, is not.

The simulation has five looks, adding 50 patients per arm each time (cumulative n = 50, 100, 150, 200, 250 per arm).

Show the R code
res <- sim_sequential_looks(n_trials = 4000, n_look = 50, n_looks = 5, seed = 11)
knitr::kable(data.frame(Setting = c(rep("Null true (p1 = p0 = 0.30), one-sided z > 1.96", 2), rep("Truth drawn from flat priors, stop at first look with Pr(p1 > p0 | y) > 0.975", 3)),
  Quantity = c("Rejection rate, one look at the end", "Rejection rate, any of 5 looks", "Trials that stopped (of 4000)",
               "Mean Monte Carlo estimate of the posterior probability at stopping", "Fraction of stopped trials where p1 > p0 truly"),
  Value = c(sprintf("%.3f", res$final_only), sprintf("%.3f", res$any_look), sprintf("%d", res$n_stopped), sprintf("%.4f", res$mean_post_at_stop), sprintf("%.4f", res$frac_truly_better))),
  align = "llr")
Table 6.11: Simulation of five looks at 50 patients per arm (4000 trials): frequentist rejection rates under the null, and the behavior of a Bayesian stopping rule when the truth is drawn from the prior used in the analysis.
Setting Quantity Value
Null true (p1 = p0 = 0.30), one-sided z > 1.96 Rejection rate, one look at the end 0.024
Null true (p1 = p0 = 0.30), one-sided z > 1.96 Rejection rate, any of 5 looks 0.069
Truth drawn from flat priors, stop at first look with Pr(p1 > p0 | y) > 0.975 Trials that stopped (of 4000) 1776
Truth drawn from flat priors, stop at first look with Pr(p1 > p0 | y) > 0.975 Mean Monte Carlo estimate of the posterior probability at stopping 0.9969
Truth drawn from flat priors, stop at first look with Pr(p1 > p0 | y) > 0.975 Fraction of stopped trials where p1 > p0 truly 0.9955

With the null true and five looks at the nominal one-sided 0.025 level, the chance of declaring success at some look is 0.069, not 0.025 (the final-look-only rate is 0.024; Table 6.11). That is the reason group sequential designs adjust the thresholds, and the reason regulators insist that the monitoring plan be prespecified (ICH E9 Section 4.5 on interim analysis). When the true response rates are drawn from the prior that the analysis assumed, the trials that stop at the first look where the posterior probability exceeds 0.975 have, on average, a Monte Carlo estimate of the posterior probability of 0.9969 at the moment they stop, and the fraction of those trials in which the treatment is truly better is 0.9955. The estimate comes from the same random draws that triggered stopping, so selection on it can push it slightly upward, and the comparison is approximate. The posterior is right on average, to that approximation, among the trials that stopped, despite the five opportunities to stop.

  • Stopping-rule invariance follows from the likelihood factorization: for an ignorable stopping mechanism and a fixed analysis prior, the stopping factor cancels. Calibration across trials additionally depends on the assumed prior and sampling model. If the true effects are not drawn from that prior, then the posterior at the moment of stopping need not be calibrated to anything in the real world, and the frequentist inflation reappears as an operating characteristic: the fraction of null drug trials that stop for success is what the regulator cares about, and it is a property of the design and the threshold, not of the posterior at a single look. For this reason one of the routes the FDA draft describes, and this book’s default for confirmatory adaptive designs without borrowing, is to calibrate Bayesian success criteria by simulation to the type I error probability, and E20 Section 5.3 describes the same operating characteristics (U.S. Food and Drug Administration 2026; International Council for Harmonisation 2025). Chapter 15 shows how.
  • A threshold calibrated for a single look must be raised, or the number of looks limited, to hold the type I error at 0.025 across the monitoring plan. Chapter 12 quantifies the price.

There is a debate, spanning decades, about what the likelihood principle implies for the way trials are run and judged (Berger 1985; Edwards, Lindman, and Savage 1963).

6.16 What a protocol has to say

TipIn the protocol

A Bayesian primary analysis needs, at minimum, the following statements in the protocol or the statistical analysis plan. They follow from the definitions of this chapter and from the FDA draft’s emphasis on prespecification.

  1. The model: the sampling distribution of the endpoint given the parameter (for example, binomial with response probability \(p_j\) in arm \(j\); or \(\hat\theta \sim N(\theta, 4/d)\) for \(\theta = -\log \mathrm{HR}\)).
  2. The prior for every parameter, with its form and values (for example, \(p_j \sim \mathrm{Beta}(1, 1)\) for both arms), its effective sample size, and the reasoning behind it. The prior is specified before the data are unblinded.
  3. The quantity on which the decision is made, with its threshold (for example, \(\Pr(p_1 - p_0 > 0 \mid \text{data}) > 0.975\), or the Pfizer-BioNTech rule \(\Pr(\mathrm{VE} > 30\%) > 0.986\) at the final analysis and \(> 0.995\) at interims), so that the success criterion is explicit.
  4. The computation: whether the posterior is analytic or by Monte Carlo (and with how many chains and draws, what seed and software, and what convergence checks), so that the result can be reproduced.
  5. The operating characteristics: type I error and power by simulation under the stated scenarios, referred to in the simulation report (Chapter 15).
  6. A statement of how the traditional analysis (estimate, confidence interval, p-value) will be reported alongside, if the sponsor wants the Bayesian analysis to be read against it.

6.17 In practice: two trials that stated their success rule as a posterior probability

The BNT162b2 vaccine trial (Section 6.6) wrote its success rule as \(\Pr(\mathrm{VE} > 30\%) > 0.986\) at the final analysis, calibrated by simulation to a one-sided type I error of 2.5%. With 8 cases in the vaccine arm against 162 in the placebo arm the posterior probability was within \(10^{-27}\) of one, and the prior played no part in the conclusion (Section 23.4).

REMAP-CAP is a platform trial (Chapter 21) whose primary analysis is a Bayesian cumulative logistic model for organ support-free days, which has no closed-form posterior (Section 6.14). Its report on interleukin-6 receptor antagonists (REMAP-CAP Investigators et al. 2021) fixed efficacy as a posterior probability above 99% that the odds ratio exceeds 1, with neutral priors, and tocilizumab crossed that threshold at an interim analysis in 2020 (99.75%). The posterior being valid at each look (Section 6.15) is what lets a platform report while it continues (Section 23.2).

Key points

  • Bayes’ rule reverses a conditional probability: posterior is proportional to prior times likelihood. On a grid, that is a product of two histograms rescaled to sum to one, for a coin, a response rate or a diagnostic test (a 27% positive predictive value from a 90% sensitive, 95% specific test at 2% prevalence).
  • Exchangeability, the judgment that the order of patients does not matter, replaces independence; for an infinitely extendible exchangeable binary sequence, de Finetti’s theorem gives a mixture of independent Bernoulli sequences, that is, a likelihood and a prior. It can fail. Randomization makes treatment assignment independent of prognosis; the response model separately assumes exchangeability within each arm or stratum.
  • The Beta prior is conjugate to the binomial: the update adds responders and non-responders. The posterior mean is a weighted average of prior mean and sample proportion, and the prior’s effective sample size is \(a + b\). The same holds for the gamma prior and event rates, where the prior is worth \(b_G\) patient-years.
  • In the normal-normal model the weight on the data is data precision over total precision, and the prior standard deviation \(\tau\) controls it: small \(\tau\) pulls strongly toward the prior mean.
  • Models with no conjugate pair, such as logistic regression and the proportional-odds model, are usually computed by Markov chain Monte Carlo, and then the protocol states the software, chains, draws, seed and convergence checks.
  • With flat priors, \(\Pr(p_1 > p_0 \mid y) = 0.9855\) matches \(1 - p = 0.9858\) for the trial of 45/100 versus 30/100, and across simulated trials the two differ by at most 0.002. In the normal-normal model on \(\theta = -\log \mathrm{HR}\) the match is exact. A Bayesian threshold of 0.975 with a flat prior is not a lower bar than a one-sided 0.025.
  • A confidence interval describes a procedure and a credible interval describes a parameter. Predictive distributions, which add the uncertainty about the parameter to the sampling variability, are wider than plug-in predictions and are the basis of predictive probability.
  • The posterior at an interim look is the same function of the data whatever the stopping rule, but the type I error of a stopping rule is not; the first is a statement about this trial, the second about repeated trials. Regulators judge a Bayesian design by the second, which is why the FDA draft recommends prior prespecification and evaluated operating characteristics, with calibration to type I error as one of its three routes and this book’s default.
NoteDiscussion questions
  1. A sponsor states that “the p-value of 0.014 means there is a 98.6% probability that the drug works.” Under what assumptions is the number right, what is the claim’s problem, and how would you rephrase it for the clinical study report?
  2. A Beta(30, 70) prior is proposed for the control arm from a historical trial of 100 patients. What is its effective sample size, how much of the posterior mean would it contribute in a current trial with 50 control patients, and what would you ask the sponsor to show about the exchangeability of the historical and current patients?
  3. A Data Monitoring Committee is shown, after 150 events, a posterior probability of benefit of 0.96 under a skeptical prior and 0.99 under a flat prior. What would you need to know to decide which number to rely on, and what does the protocol have to have said beforehand?
  4. A colleague says Bayesian monitoring is free because the posterior is unaffected by looking. Using the simulation in Table 6.11, explain what is true in that sentence and what is not.
  5. ICH E9 permits Bayesian approaches when “the reasons for their use are clear and when the resulting conclusions are sufficiently robust.” Draft two sentences for a protocol that meet that expectation for the normal-normal analysis of Section 6.13.