From Trial Responses to a Posterior Distribution
For a binary clinical-trial endpoint, each participant either meets the response definition or does not. The response rate \(p\) is the probability of response for a participant represented by the model. After observing a trial, the goal is not only to report the observed proportion but to summarize uncertainty about \(p\) using the prior information and the data together.
This tutorial considers a single response rate with a beta prior and binomial data. It focuses on computing the posterior parameters and then obtaining the posterior mean, variance, and credible interval. These summaries are meaningful only when the outcome and analysis population are clearly defined and the model is suitable for the trial.
In the beta distribution, \(a\) is the shape parameter associated with responses and \(b\) is the shape parameter associated with nonresponses. Both parameters must be positive. They are sometimes described as prior pseudo-counts, but they are not necessarily literal numbers of previously observed participants; their meaning depends on the chosen prior and its context.
This is the beta-binomial conjugate update. It gives a compact calculation: the prior parameters and the two observed counts determine the full posterior distribution. The update does not require replacing the observed response proportion \(x/n\) with a new point estimate; it produces a distribution that retains uncertainty about the unknown response probability.
Posterior Mean, Variance, and Interval
For \(p\mid X=x\sim\mathrm{Beta}(A,B)\), where \(A=a+x\) and \(B=b+n-x\), the posterior mean and variance are
The posterior mean is the center of mass of the posterior distribution. Since \(p\) is a probability, both the mean and the standard deviation are on the probability scale and have no physical units. The variance is in squared probability-scale units. The posterior mean is not generally equal to the observed response proportion: it reflects both the observed data and the prior.
A 95% equal-tailed credible interval is bounded by the 2.5th and 97.5th percentiles of the posterior. If \(F^{-1}_{A,B}(q)\) denotes the \(q\) quantile of a \(\mathrm{Beta}(A,B)\) distribution, its endpoints are
The interval assigns 2.5% posterior probability to each tail, for a total posterior probability of 95% between the endpoints. Its endpoints are usually found with statistical software or a beta-distribution quantile table. The interval does not mean there is a 95% probability that a fixed, unknown \(p\) lies in this particular interval; rather, under the model and prior, the posterior probability that \(p\) lies between these computed endpoints is 95%.
The formulas for the mean and variance follow directly from the beta density. Define the beta function by \(B(A,B)=\int_0^1p^{A-1}(1-p)^{B-1}\,dp\). The density is \(p^{A-1}(1-p)^{B-1}/B(A,B)\), and the beta-function identity \(B(A+1,B)=A B(A,B)/(A+B)\) gives the mean:
Applying the identity twice gives \(E(p^2)=A(A+1)/[(A+B)(A+B+1)]\). Therefore,
These calculations establish the posterior summaries once the updated parameters are known. They do not remove the need to justify the model or prior: exact arithmetic under an unsuitable model can still give misleading conclusions.
Worked Updates for Response Rates
Worked Example: A Uniform Prior and 10 Responses
Suppose, hypothetically, that 10 of 20 participants in a trial meet a prespecified binary response definition. Use a uniform prior, \(p\sim\mathrm{Beta}(1,1)\), and calculate the posterior mean, variance, and 95% equal-tailed credible interval.
The data are \(x=10\) responses and \(n-x=20-10=10\) nonresponses. The update gives
The posterior mean is
The posterior variance is
Numerical beta quantiles give a 95% equal-tailed credible interval of approximately \([0.238,0.762]\). Under this prior and model, the posterior probability that the response rate lies between 0.238 and 0.762 is 95%. The endpoints are probabilities, or equivalently 23.8% and 76.2% response rates. The symmetry of the posterior here follows from equal posterior parameters, not from a general property of beta posteriors.
Worked Example: A Prior Favoring Lower Response Rates
Consider hypothetical data with 3 responses among 12 participants. Suppose the prior is \(\mathrm{Beta}(1,9)\), which has mean \(1/(1+9)=0.1000\). Compute the posterior summaries.
There are \(12-3=9\) nonresponses. The posterior parameters are \(A=1+3=4\) and \(B=9+9=18\), so
The posterior mean is
The posterior variance is
The 95% equal-tailed interval, calculated from the \(\mathrm{Beta}(4,18)\) quantiles, is approximately \([0.052,0.362]\). The sample response proportion is \(3/12=0.2500\), while the posterior mean is about 0.1818. The difference is not a computational inconsistency: this prior places more weight on lower response rates, and the sample is small enough that the prior still influences the posterior. Whether that prior is appropriate must be assessed using substantive knowledge and prior predictive checks.
Worked Example: No Responses in a Small Trial
Suppose, hypothetically, that none of 8 participants respond. Use the uniform prior \(\mathrm{Beta}(1,1)\). This example illustrates why an observed proportion of zero does not imply that the response probability is known to be zero.
Here \(x=0\) and \(n-x=8\). The posterior is
The posterior mean and variance are
For \(\mathrm{Beta}(1,9)\), the cumulative distribution function is \(F(p)=1-(1-p)^9\). Solving \(F(p)=q\) gives \(F^{-1}(q)=1-(1-q)^{1/9}\). Thus the equal-tailed 95% interval is
Although the observed response proportion is 0, the posterior retains uncertainty about positive response rates. The result depends on the stated prior; it is not a prior-free conclusion about the trial.
Checking the Model and Choosing a Summary
Before interpreting a beta-binomial update, check that the response definition is clinically meaningful and that the denominator \(n\) is the intended analysis population. The binomial model treats responses as independent outcomes with a common probability \(p\). It can be inadequate when response probabilities differ systematically across participants, sites, or follow-up conditions, or when outcomes are correlated within clusters. In such settings, a single common-\(p\) binomial model may understate uncertainty or fail to represent the data-generating process.
Missing outcomes also require attention. The update uses the number of observed responses and nonresponses; it does not automatically account for participants whose response status is unknown. Treating every missing outcome as a nonresponse, excluding participants, or imputing outcomes corresponds to a substantive analysis choice. That choice should be explicit, and conclusions may need sensitivity analyses.
The prior deserves a similar check. A prior with a small total \(a+b\) usually contributes less information than one with a much larger total, but total concentration alone does not describe its full shape. Examine whether the prior places plausible probability on clinically relevant response rates. A prior predictive check can reveal a prior that would generate implausible trial outcomes before the current data are considered.
Equal-tailed intervals are simple to define and interpret, but for a skewed beta posterior they need not be the shortest interval containing 95% posterior probability. A highest-posterior-density interval is another posterior interval construction. The choice should be stated; changing the interval definition can change the endpoints, even when the posterior distribution is unchanged. For routine reporting, the posterior mean and equal-tailed interval provide a transparent summary, while the full posterior shape can matter when decisions depend on thresholds.
A frequentist confidence interval is a different alternative: it is constructed to have a specified long-run coverage under repeated sampling, rather than to contain a specified posterior probability conditional on the data and prior. The observed proportion \(x/n\) is another useful summary, but it is not an uncertainty interval and does not incorporate a prior. These approaches answer related, but not identical, questions.
Common Mistakes and Practical Diagnostics
- Adding all participants to the first parameter. The first beta parameter increases by responses, not by the total sample size. Add \(x\) to \(a\), and add \(n-x\) to \(b\).
- Calling the posterior mean the observed rate. The observed proportion is \(x/n\); the posterior mean is \((a+x)/(a+b+n)\). They agree in some cases, but not in general.
- Interpreting the interval as a confidence interval. A Bayesian credible interval has its stated posterior probability under the model and prior. A frequentist confidence interval has a repeated-sampling coverage interpretation.
- Assuming conjugacy guarantees a good model. The update is convenient, but it does not verify independence, a common response probability, an appropriate response definition, or a defensible prior.
- Reporting too many digits. Beta quantiles are usually numerical approximations. Report sensible precision, state the interval level, and describe the endpoints as response probabilities or percentages.
Check Your Understanding
Try each question, then compare your reasoning with the solutions below.
- A hypothetical trial has 6 responses among 15 participants and prior \(\mathrm{Beta}(2,3)\). What is the posterior distribution?
- For the posterior in Question 1, calculate the posterior mean and variance.
- With prior \(\mathrm{Beta}(1,1)\), what posterior follows from 0 responses among 5 participants? What does this illustrate?
- State the interpretation of a 90% equal-tailed credible interval for a response rate.
- Name two conditions under which a common-\(p\) binomial model could be questionable.
Solutions. (1) There are \(15-6=9\) nonresponses, so the posterior is \(\mathrm{Beta}(2+6,3+9)=\mathrm{Beta}(8,12)\). (2) The mean is \(8/(8+12)=0.4000\). The variance is \(8(12)/[(20)^2(21)]=96/8400\approx0.01143\). (3) The posterior is \(\mathrm{Beta}(1,6)\). Even with no observed responses, uncertainty about positive response rates remains under this prior. (4) Under the stated model and prior, the posterior probability that the response rate lies between the interval endpoints is 90%; it is not a claim that a fixed parameter has a 90% chance of being in an interval after that interval has been computed. (5) Examples include correlated outcomes within sites or clusters, and systematic variation in response probabilities among participants.