Tutorials › Bayesian Clinical Trials › Posterior Inference for a Binary Risk Ratio

Posterior Inference for Trial Endpoints · Tutorial 6 of 696

Posterior Inference for a Binary Risk Ratio

Learn to derive, summarize, and interpret a posterior risk ratio, including credible intervals and the limitations of approximations when events are uncommon.

Beginner 10 min read

What You'll Learn

  • Define the treatment-to-control risk ratio and the assumptions behind independent beta posteriors.
  • Derive its posterior distribution through a cumulative distribution function.
  • Calculate the posterior mean risk ratio and distinguish it from the ratio of posterior mean risks.
  • Construct and interpret equal-tail credible intervals for the risk ratio.
  • Work through an uncommon-event example and assess when a log-scale approximation may be unreliable.
  • Compare the risk ratio with the risk difference and recognize key diagnostic and interpretation pitfalls.

Why Use a Posterior Risk Ratio?

A binary trial endpoint might be whether a participant experienced an adverse event by a specified follow-up time. Comparing the event risk in the treatment arm with the risk in the control arm on a ratio scale answers a relative question: how many times as large is one risk as the other? A risk ratio below 1 indicates a lower event risk in the treatment arm; a risk ratio above 1 indicates a higher one. The posterior distribution expresses uncertainty about that comparison, rather than reducing it to a single estimate.

Let \(p_T\) and \(p_C\) denote the event probabilities in the treatment and control arms. The quantity of interest here is the treatment-to-control risk ratio. The derivation uses the beta-binomial posterior for each arm; the posterior risk difference is a related but distinct summary.

Definition: The binary risk ratio is \(R=p_T/p_C\), where \(p_T\) is the treatment-arm event probability and \(p_C\) is the control-arm event probability. A value \(R=1\) means equal event risks; \(R<1\) means the treatment-arm risk is lower; and \(R>1\) means it is higher. The posterior risk ratio is the distribution of \(R\) induced by the joint posterior distribution of \(p_T\) and \(p_C\).

Model and Assumptions

Suppose the trial observes \(y_T\) events among \(n_T\) participants in the treatment arm and \(y_C\) events among \(n_C\) participants in the control arm. Within each arm, participants are modeled as independent Bernoulli observations with a common event probability. Thus, the arm-specific event counts have binomial likelihoods. Use independent beta priors for the two probabilities:

$$ p_T\sim\operatorname{Beta}(a_T,b_T),\qquad p_C\sim\operatorname{Beta}(a_C,b_C). $$

Here each beta distribution has positive shape parameters. Conditional on its arm’s probability, each participant’s event status follows the Bernoulli model; the two event counts are conditionally independent given \(p_T\) and \(p_C\). The priors are independent across arms. With these assumptions, the posterior distributions are

$$ p_T\mid \text{data}\sim\operatorname{Beta}(A_T,B_T),\qquad p_C\mid \text{data}\sim\operatorname{Beta}(A_C,B_C), $$
$$ A_T=a_T+y_T,\quad B_T=b_T+n_T-y_T,\qquad A_C=a_C+y_C,\quad B_C=b_C+n_C-y_C. $$

The two posterior probabilities remain independent under this model. This matters because the posterior for their ratio can be obtained from independent draws from the two beta distributions. The model does not itself establish a causal treatment effect. A causal interpretation depends on the trial design, conduct, endpoint definition, and target population, among other considerations.

Distribution and Summaries of the Ratio

A ratio of independent beta random variables does not, in general, have a beta distribution. It is therefore not enough to find a beta posterior for each arm and then label the ratio with a familiar beta distribution. The ratio’s posterior distribution can instead be defined through its cumulative distribution function. For \(r\geq 0\), conditioning on the control-arm risk gives

$$ F_R(r) =P\left(\frac{p_T}{p_C}\leq r\mid\text{data}\right) =\int_0^1 F_T(rc)\,f_C(c)\,dc, $$

where \(F_T\) is the posterior cumulative distribution function of \(p_T\), and \(f_C\) is the posterior density of \(p_C\). Since \(p_T\leq 1\), the value of \(F_T(rc)\) is 1 when \(rc\geq 1\). Numerical integration or draws from the two independent beta posteriors can be used to obtain ratio quantiles. An equal-tail 95% credible interval is bounded by the 2.5th and 97.5th percentiles of the posterior distribution of \(R\).

Interpretation: A 95% posterior credible interval for \(R\) is an interval containing 95% of the posterior probability for the risk ratio, conditional on the model, priors, and observed data. It is not a statement that the fixed parameter has a 95% chance of lying in the particular interval.

The posterior mean of the risk ratio has a simple expression when \(A_C>1\). Independence implies that the expectation of the product \(p_T(1/p_C)\) factors into two expectations. The beta density gives \(E(p_T\mid\text{data})=A_T/(A_T+B_T)\). For \(p_C\sim\operatorname{Beta}(A_C,B_C)\), integrating \(1/p_C\) against its density yields \(E(1/p_C)=(A_C+B_C-1)/(A_C-1)\), provided \(A_C>1\). Therefore,

$$ E(R\mid\text{data}) =\frac{A_T}{A_T+B_T}\, \frac{A_C+B_C-1}{A_C-1}, \qquad A_C>1. $$

This is generally not the same as the ratio of posterior mean risks, which is \(\{A_T/(A_T+B_T)\}/\{A_C/(A_C+B_C)\}\). The mean of a ratio and the ratio of means are different summaries. In addition, a posterior mean alone does not describe the distribution’s spread or skewness; a credible interval or other distributional summary is needed to convey uncertainty.

Worked Examples

Worked Example: A Posterior Mean Risk Ratio

In a hypothetical trial, 8 of 80 treatment-arm participants and 12 of 80 control-arm participants experience the endpoint. Use independent \(\operatorname{Beta}(1,1)\) priors and calculate the posterior mean risk ratio.

The beta-binomial update gives \(p_T\mid\text{data}\sim\operatorname{Beta}(9,73)\) and \(p_C\mid\text{data}\sim\operatorname{Beta}(13,69)\). Since \(A_C=13>1\), the posterior mean formula applies:

$$ E(R\mid\text{data}) =\frac{9}{9+73}\frac{13+69-1}{13-1} =\frac{9}{82}\frac{81}{12} =\frac{729}{984} \approx 0.7409. $$

The ratio of the posterior mean risks is instead \[ \frac{9/82}{13/82}=\frac{9}{13}\approx 0.6923. \] These are distinct calculations and answer different summary questions. The posterior mean risk ratio is about 0.741: on average under this posterior distribution, the treatment-arm risk is about 0.741 times the control-arm risk. This single number does not establish that the risk ratio is below 1 with high posterior probability; that requires examining the posterior distribution or a relevant posterior probability.

Worked Example: An Approximate Credible Interval

For the hypothetical data in the previous example, an approximate interval can be constructed on the log-risk-ratio scale. If \(p\sim\operatorname{Beta}(A,B)\), the posterior mean and variance of \(\log p\) are \(\psi(A)-\psi(A+B)\) and \(\psi_1(A)-\psi_1(A+B)\), respectively; \(\psi\) and \(\psi_1\) are the digamma and trigamma functions. Independence gives the mean and variance of \(\log R=\log p_T-\log p_C\) by subtracting the means and adding the variances.

In this example the arm totals are both 82, so the posterior mean of \(\log R\) is \(\psi(9)-\psi(13)\approx -0.3854\). Its variance is

$$ \psi_1(9)+\psi_1(13)-2\psi_1(82) \approx 0.1175+0.0800-2(0.01227) \approx 0.1729. $$

The approximate standard deviation is \(\sqrt{0.1729}\approx 0.4159\). Approximating \(\log R\) by a normal distribution gives an approximate 95% interval on the log scale of \[ -0.3854\pm1.96(0.4159)=(-1.201,\ 0.430). \] Exponentiating both endpoints gives an approximate 95% posterior interval for \(R\) of \((0.301,\ 1.537)\). Under this approximation, the interval includes 1, so it does not exclude equal event risks. This is an approximation, not the exact beta-ratio quantile interval; numerical integration or posterior draws can be used to compute the latter.

Worked Example: Uncommon Events and Approximation Caution

Consider a hypothetical trial with 1 event among 100 treatment-arm participants and 4 events among 100 control-arm participants. Again use independent \(\operatorname{Beta}(1,1)\) priors. The posterior distributions are \(p_T\mid\text{data}\sim\operatorname{Beta}(2,100)\) and \(p_C\mid\text{data}\sim\operatorname{Beta}(5,97)\). The posterior mean ratio is

$$ E(R\mid\text{data}) =\frac{2}{102}\frac{5+97-1}{5-1} =\frac{2}{102}\frac{101}{4} \approx 0.4951. $$

For an illustrative log-scale approximation, the mean of \(\log R\) is \(\psi(2)-\psi(5)\approx-1.0833\), and its variance is

$$ \psi_1(2)+\psi_1(5)-2\psi_1(102) \approx 0.6449+0.2213-2(0.009852) \approx 0.8466. $$

The approximate standard deviation is \(0.9201\). A normal approximation for \(\log R\) gives \(-1.0833\pm1.96(0.9201)=(-2.887,\ 0.720)\); exponentiating gives an approximate interval of \((0.0557,\ 2.054)\). This interval is broad and includes 1. With uncommon events, a log-normal approximation may represent the ratio’s skewness poorly. For a reported interval, calculate the posterior ratio quantiles directly from the beta posteriors, using the CDF integral or independent posterior draws, and state clearly if an approximation was used.

Diagnostics, Alternatives, and Limitations

The model and computation should be checked before interpreting a risk ratio. Confirm that the endpoint is defined consistently across arms and that the event counts and denominators match the intended analysis population. Check that the independent-arm binomial model is suitable: it assumes a common event probability for participants within each arm and independent outcomes conditional on that probability. Clustering, repeated measurements, substantial dependence, or important differences in follow-up may require a different model. Also verify that the prior choices and their implications are appropriate for the clinical question.

A useful computational check is to draw many independent values from the two beta posteriors, calculate \(R^{(m)}=p_T^{(m)}/p_C^{(m)}\) for each draw \(m\), and compare the resulting quantiles with numerical integration. Increase the number of draws if reported quantiles vary materially across runs. The ratio is positive, and its posterior can be right-skewed, especially when the denominator risk has substantial posterior mass near zero. In that setting, a posterior mean can be sensitive to the tail; report a credible interval and consider the posterior median as well. The posterior mean formula also requires \(A_C>1\); if that condition is not met, the posterior mean of \(1/p_C\), and hence the posterior mean of \(R\), is not finite. Quantiles can still be defined.

The risk ratio emphasizes relative change, whereas the risk difference \(p_T-p_C\) describes an absolute change in event probability. For example, a similar risk ratio can correspond to different absolute risk changes at different baseline risks. The odds ratio uses a different scale and is not interchangeable with the risk ratio, particularly when events are not uncommon. Choose and report the measure that matches the clinical question; do not interpret a risk ratio as an absolute reduction in percentage points.

Common pitfall: “The treatment-arm posterior mean risk divided by the control-arm posterior mean risk is the posterior mean risk ratio.” This is generally false: the expectation of \(p_T/p_C\) is not the ratio of the expectations. Use the posterior mean formula when its condition holds, or summarize the joint posterior draws or ratio distribution directly.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. Define the treatment-to-control risk ratio and state what a value below 1 means.
  2. If \(p_T\) and \(p_C\) have independent beta posteriors, how can the posterior CDF of \(R\) be obtained?
  3. For independent posteriors \(\operatorname{Beta}(A_T,B_T)\) and \(\operatorname{Beta}(A_C,B_C)\), what condition is needed for the posterior mean of \(R\) to be finite?
  4. Why is a ratio of posterior mean risks not generally the posterior mean risk ratio?
  5. Why should an approximate log-scale interval be treated cautiously when events are uncommon?

Solutions. (1) \(R=p_T/p_C\); a value below 1 means the treatment-arm event risk is lower. (2) Use \(F_R(r)=\int_0^1F_T(rc)f_C(c)\,dc\) for \(r\geq0\), or obtain quantiles from independent posterior draws. (3) Require \(A_C>1\), so \(E(1/p_C)\) is finite. (4) In general, \(E(p_T/p_C)\neq E(p_T)/E(p_C)\); independence instead gives \(E(p_T)E(1/p_C)\), when finite. (5) The ratio posterior can be skewed, and the normal approximation on the log scale may not capture its tail behavior well.

Clinical Biostats