Why predict event counts from a beta prior?
For a binary clinical endpoint, investigators often specify prior uncertainty about the event probability \(p\), then ask what event counts that prior implies in a trial of a particular size. A prior that seems reasonable when described as a range of event rates can still imply surprising numbers of zero-event trials or unusually large counts. Predicting the count makes those implications concrete.
This tutorial considers one group of \(n\) participants with a common event probability \(p\). The event count is a prior predictive quantity: it accounts both for variation in trial outcomes conditional on \(p\) and for uncertainty about \(p\) before observing the trial data.
The common probability assumption means that, conditional on \(p\), participants have the same event chance. The independence assumption is conditional on that probability: after averaging over the uncertain \(p\), participant outcomes are generally dependent. This model may be inappropriate if event risks differ systematically across participants, follow-up varies in a way that changes event opportunity, or outcomes are otherwise dependent beyond the shared \(p\).
Deriving the predictive distribution
The predictive probability of a count is obtained by averaging its binomial probability over the prior distribution of \(p\). The beta density is \(p^{a-1}(1-p)^{b-1}/B(a,b)\) for \(0<p<1\), where \(B\) is the beta function. Thus, for \(y=0,1,\ldots,n\),
This is the beta-binomial distribution. The integral in the second line is a beta-function integral, with parameters \(a+y\) and \(b+n-y\). The formula includes the binomial coefficient because \(Y\) counts all possible arrangements of \(y\) events among \(n\) participants. It is a probability mass function over the integers from zero to \(n\), not a continuous distribution over event rates.
An equivalent expression is useful for calculations. Define the rising factorial \((c)_m=c(c+1)\cdots(c+m-1)\), with \((c)_0=1\). Then
The predictive probabilities are not, in general, the probabilities from a binomial distribution with \(p\) set equal to its prior mean. That plug-in calculation ignores uncertainty in \(p\), which is one source of variation in the prior predictive count.
Worked Example: Predicting the Count Under Beta(2, 18)
Suppose, hypothetically, a trial plans to observe a binary event in \(n=20\) participants, and the event probability has prior \(p\sim\operatorname{Beta}(2,18)\). The prior mean event probability is \(2/(2+18)=0.10\). Find the predictive mean and variance of the event count, then calculate the probability of observing no events.
For this prior, \(a+b=20\). The predictive mean is \(n a/(a+b)\), so
The predictive variance, derived below, is \(n ab(a+b+n)/[(a+b)^2(a+b+1)]\). Substitution gives
For zero events, the beta-binomial probability simplifies to \(P(Y=0)=B(a,b+n)/B(a,b)=(b)_n/(a+b)_n\). Here the products cancel:
Thus the prior predictive probability of a zero-event trial is about 23.1%. Using only the mean rate in a binomial model would instead give \(0.9^{20}=0.1216\). That smaller value is not the beta-binomial prediction: it omits prior uncertainty about the event probability.
Predictive mean and variance
Write \(s=a+b\) and \(q=a/(a+b)\), so \(q=E(p)\) and \(\operatorname{Var}(p)=q(1-q)/(s+1)\). Conditional on \(p\), the binomial count has mean \(np\) and variance \(np(1-p)\). Applying the laws of total expectation and total variance gives the predictive moments.
For the variance, first average the conditional variance and then add the variance of the conditional mean. Since \(E[p(1-p)]=q(1-q)s/(s+1)\), the complete calculation is
The first variance contribution is the average binomial sampling variation; the second is variation in the count’s conditional mean as \(p\) varies across the prior. Because \(n+s>s+1\) when \(n>1\), the predictive variance exceeds the binomial variance \(nq(1-q)\) for a fixed probability equal to the prior mean. The difference does not mean that participants are dependent conditional on \(p\). Rather, integrating over the shared uncertain \(p\) makes their outcomes positively associated marginally.
The prior concentration \(s=a+b\) helps describe this effect. At fixed prior mean \(q\), larger \(s\) means smaller \(\operatorname{Var}(p)\), and the predictive variance approaches the binomial variance as \(s\) grows. This interpretation is useful only when comparing priors with the same mean; changing \(a\) and \(b\) can also change the mean.
Extreme counts and tail probabilities
An extreme count is interpreted relative to the trial size and clinical setting. The endpoint counts have particularly simple predictive probabilities:
For a specified threshold \(k\), calculate a lower-tail probability by summing the probability mass function, for example \(P(Y\leq k)=\sum_{y=0}^{k}P(Y=y)\). Similarly, \(P(Y\geq k)=\sum_{y=k}^{n}P(Y=y)\). These probabilities describe what the prior model predicts before observing the trial; they are not posterior probabilities about the prior or evidence that the model is true.
Worked Example: Comparing the Two Endpoint Counts
Consider a hypothetical eight-participant trial with prior event probability \(p\sim\operatorname{Beta}(1,9)\). Calculate the prior predictive probabilities of zero events and eight events. These are the two most extreme possible counts.
For zero events, cancellation in the rising-factorial ratio gives
For events in all eight participants, the corresponding ratio is
The two endpoint probabilities differ greatly. The prior mean event rate is \(1/10=0.10\), so an all-event trial is very unlikely, while a zero-event trial has substantial prior predictive probability. A prior predictive check should consider these probabilities in light of the trial size and clinical context, rather than treating the two extremes as equally plausible.
Worked Example: Checking a Zero-Event Probability
Suppose a hypothetical 12-participant trial is assigned \(p\sim\operatorname{Beta}(3,27)\), a prior with mean event probability \(0.10\). Calculate the expected count, predictive variance, and probability of zero events, and compare the last quantity with a binomial calculation at the prior mean.
Here \(s=30\), \(q=0.10\), and \(n=12\). The mean and variance are
For zero events, canceling the common factors in the rising-factorial ratio yields
The plug-in binomial probability is \(0.9^{12}=0.2824\). The beta-binomial probability is higher because the prior allows event probabilities both below and above 0.10; low values of \(p\) contribute disproportionately to the chance of no events. Whether a 34.3% zero-event probability is acceptable depends on the clinical purpose and design, but it is a clear implication to report and assess.
Using the distribution as a prior predictive check
A practical check starts by fixing the endpoint definition and the trial size, then calculating or simulating event counts under the specified prior. For a beta-binomial model, exact probabilities are available, so simulation is not required for basic count summaries. Simulation can still help visualize the distribution or evaluate more complicated predictive quantities.
Confirm that the count is based on a fixed number of participants with a common event probability and binary outcomes observed under the assumed follow-up.
Use the beta-binomial mass function, moments, and clinically relevant tail probabilities, including zero or unusually large counts where relevant.
Compare the predicted counts with what would be credible for the planned trial. If implications are unacceptable, revisit the prior or the model assumptions and document the reason for any change.
This check is different from comparing observed trial data with a fitted model: no trial outcomes are used to update the prior. It is also more informative than looking only at the prior mean event rate. The mean count can look reasonable while the distribution assigns substantial probability to counts that would be surprising or consequential in the actual trial.
Common mistake, alternatives, and limitations
- Replacing the prior by its mean. The reasoning “the prior mean rate is \(q\), so the count is \(\operatorname{Binomial}(n,q)\)” discards uncertainty in \(p\). The correction is to integrate the binomial likelihood over the beta prior; this gives the beta-binomial distribution and includes both sources of variation.
- Confusing an event-rate prediction with a count prediction. A prior on \(p\) concerns a probability between zero and one; \(Y\) is an integer between zero and \(n\). State which quantity a probability refers to.
- Assuming the model covers every trial feature. A common \(p\) and conditional independence may not represent heterogeneous risks, clustering, unequal observation times, or informative missing outcomes. A beta-binomial count is not a remedy for every form of extra variation; the model must match the data-generating assumptions.
- Interpreting predictive probability as certainty. A large prior predictive probability for a count does not establish that the count will occur, and a small probability does not prove the prior is invalid. It identifies an implication to judge against clinical knowledge and design goals.
The binomial model with \(p\) fixed at its prior mean is a useful comparison, but it answers a different question by treating the rate as known. The beta-binomial model retains uncertainty about one shared event rate. More elaborate models may be needed when participants have distinct risks or when dependence cannot reasonably be represented by a single shared \(p\); those alternatives should be chosen for the scientific structure, not merely to inflate predictive variance.
Check Your Understanding
Try each problem, then compare your reasoning with the solutions below.
- Under \(p\sim\operatorname{Beta}(4,16)\) and \(n=10\), what are the prior mean event rate and predictive mean count?
- Why is the beta-binomial predictive variance generally larger than the binomial variance calculated at the prior mean?
- For \(p\sim\operatorname{Beta}(1,4)\) and \(n=4\), calculate the probability of zero events.
- In one sentence, explain what a prior predictive probability of zero events means for a planned trial.
Solutions. (1) The mean rate is \(4/(4+16)=0.20\); the expected count is \(10(0.20)=2.00\) events. (2) The beta-binomial variance includes both average conditional binomial variation and variation in the conditional mean \(np\) across the prior, so it includes uncertainty in \(p\). (3) \(P(Y=0)=(4)_4/(5)_4=(4\cdot5\cdot6\cdot7)/(5\cdot6\cdot7\cdot8)=4/8=0.5000\). (4) It is the probability, before observing trial outcomes and averaging over the specified prior on \(p\), that none of the \(n\) participants has the event under the assumed model.