Nytel Testing 1. From prior to posterior IndexNext →
Module 1

From prior to posterior

What do you believe about a drug's true response rate before the trial data, and after?

Try an example:

You know nothing about this new drug, so every true response rate starts equally likely.

A drug's true response rate is the share of patients it helps: 0.5 means half. Your prior is your belief before the trial; the posterior is your belief after.

1. Prior: what you believe

Flat: every true response rate starts equally believable. Or drag the orange bars.

2. Data: add patients

3. Combine

What you believed (prior)
How well each possible rate fits the data (the likelihood)
What you believe now (posterior)

Hover or tap a bar to see the arithmetic.

Textbook example: 100 patients instead of 10. Same bell-shaped start, narrower belief.

Prior

Posterior for 10 patients

Posterior for 100 patients

Predict, then check

A shortcut: one smooth curve

Bars work, but they are clumsy: one multiplication per bar. A smooth curve does the same job with two numbers.

One specific sequence

Four patients: R = responded, N = did not.

0.60

\[\theta\times\theta\times(1-\theta)\times\theta=\theta^{3}(1-\theta)\]

Any one sequence with \(h\) responders and \(t\) non-responders has chance \(\theta^{h}(1-\theta)^{t}\), whatever the order.

How many sequences have h responders?

List them all. Pick the number of patients and the number of responders.

4
2

The count is called "n choose h", written \(\binom{n}{h}\). It is the number of rows in the list.

Optional: counting orderings

Count without listing (\(t=n-h\)):

\[\binom{n}{h}=\frac{n!}{h!\,t!}\]

Put together: the binomial

Chance of \(h\) responders in \(n\) patients:

\[\binom{n}{h}\,\theta^{h}(1-\theta)^{t}\]

4
0.60

The count does not depend on θ, so it only scales the curve and never changes its shape. That is why the fit curve (and, from a flat prior, the posterior) is just \(\theta^{h}(1-\theta)^{t}\).

Bars and formula agree

Its name

Start from no idea (flat bars): after \(h\) responders and \(t\) non-responders the posterior has exactly this shape, called a Beta curve, Beta(\(h+1\), \(t+1\)). Beta(a, b) = as if you had already seen a − 1 responders and b − 1 non-responders. Beta(1, 1) = no patients yet. The best guess, the average of the curve, is a/(a + b).

Each curve's height shows how believable each true response rate is. The orange tick marks the best guess a/(a + b).

The shortcut

Beta(a, b), then \(h\) responders and \(t\) non-responders, gives \[\mathrm{Beta}(a+h,\; b+t)\]

Example: Beta(1, 1), then 7 responders and 3 non-responders, gives Beta(8, 4), best guess 8/12 = 0.67

Book chapter 3. Try it: set the prior, then add patients.

Prior Beta(a, b)

1
1

Data

1. Prior as a smooth curve
2. How well each possible rate fits the data
3. Posterior
Same answer, much less work.

Predict, then check

A real small trial: ECMO

ECMO is a machine that adds oxygen to a sick newborn's blood. All 11 newborns on it survived (press "Newborn trial (real)" above).

Standard care had 0 of 1 survive. With flat priors for both arms, how likely is it that ECMO truly saves more newborns?

Same data: ECMO 11 of 11, standard care 0 of 1, flat priors, simulated from the two posteriors. One baby on standard care is very little to compare with. Source: Bartlett et al. (1985), Pediatrics.

Regulator's corner

Bayesian means prior plus data, as on this page. FDA draft advice (January 2026):

"It is always critical for Bayesian analyses to have a prespecified prior…"

Section IV.B. FDA draft guidance, Use of Bayesian Methodology in Clinical Trials of Drug and Biological Products. In a trial: choose the prior before treating anyone.

Takeaway