Tutorials › Bayesian Clinical Trials › Posterior Inference for Paired Binary Outcomes

Posterior Inference for Trial Endpoints · Tutorial 9 of 696

Posterior Inference for Paired Binary Outcomes

Use discordant-pair counts to update a Bayesian model for paired binary outcomes and interpret posterior evidence about the treatment-minus-control event risk difference.

Beginner 11 min read

What You'll Learn

  • Identify the four paired binary outcome counts and the discordant pairs.
  • Derive beta posterior distributions for the discordance rate and the direction among discordant pairs.
  • Express the paired event risk difference using discordance and direction probabilities.
  • Calculate posterior probabilities that the paired event difference is positive.
  • Recognize what zero or few discordant pairs do and do not establish.
  • Check the assumptions behind paired inference and distinguish it from an independent-groups analysis.

Why Pairing Changes the Analysis

When each study unit contributes an outcome under both conditions, the two binary outcomes are linked. Examples include a crossover trial in which the same participant receives both treatments, or a matched design in which each pair contains one unit assigned to each treatment. The association within a pair matters: the evidence about the difference is concentrated in pairs whose outcomes disagree.

Let treatment and control outcomes for pair \(i\) be \(T_i\) and \(C_i\), each coded 1 for an event and 0 for no event. Define \(n_{11}\) as the number of pairs with an event under both conditions, \(n_{00}\) as the number with no event under either, \(n_{10}\) as the number with an event under treatment only, and \(n_{01}\) as the number with an event under control only. The sample contains \(n=n_{11}+n_{00}+n_{10}+n_{01}\) pairs.

Definition: The discordant pairs are those with different outcomes: treatment only (\(n_{10}\)) or control only (\(n_{01}\)). Their total is \(m=n_{10}+n_{01}\). The paired event risk difference is \(\Delta=P(T_i=1)-P(C_i=1)\), the population event probability under treatment minus that under control for the paired-unit population.

Pairs with matching outcomes contribute to the total number of observed pairs, but not to the difference in event counts: each \(n_{11}\) pair adds one event to both conditions, and each \(n_{00}\) pair adds none to either. Therefore the observed difference in the two event proportions is \((n_{10}-n_{01})/n\). The analysis below makes explicit how the discordant outcomes inform the population difference.

A Two-Part Model for Paired Outcomes

For a randomly selected pair, let \(q\) be the probability that its outcomes are discordant. Conditional on being discordant, let \(\theta\) be the probability that the event occurs under treatment only. Thus the probability of a control-only event, conditional on discordance, is \(1-\theta\). These parameters separate how often pairs disagree from which condition tends to have the event in those disagreements.

Definition: In the paired binary model, \(q=P(T_i\ne C_i)\), and \(\theta=P(T_i=1,C_i=0\mid T_i\ne C_i)\). The paired event risk difference satisfies \(\Delta=q\theta-q(1-\theta)=q(2\theta-1)\).

This identity follows because the treatment event probability exceeds the control event probability only through the discordant patterns: treatment-only pairs have probability \(q\theta\), while control-only pairs have probability \(q(1-\theta)\). Concordant pairs cancel in the subtraction. Consequently, if \(q>0\), the sign of \(\Delta\) is the sign of \(\theta-\tfrac12\). The frequency of discordance affects the size of the difference; the balance between the two directions determines its sign.

Assume pairs are independent draws from a population with the same \(q\) and \(\theta\), and that outcomes are completely observed. Assign independent priors \(q\sim\operatorname{Beta}(c,d)\) and \(\theta\sim\operatorname{Beta}(a,b)\), with positive shape parameters. The likelihood, apart from the multinomial coefficient, is

$$ L(q,\theta)\propto q^m(1-q)^{n-m}\theta^{n_{10}}(1-\theta)^{n_{01}}. $$

The likelihood separates into a term for discordance and a term for direction among discordant pairs. Multiplying by the independent beta prior densities gives the following conjugate updates.

Theorem: Under the model and priors above, the posterior distributions are independent and satisfy \(q\mid\text{data}\sim\operatorname{Beta}(c+m,d+n-m)\) and \(\theta\mid\text{data}\sim\operatorname{Beta}(a+n_{10},b+n_{01})\). In particular, conditional on the observed number \(m\) of discordant pairs, \(n_{10}\) has a binomial likelihood with size \(m\) and probability \(\theta\).

For example, the posterior density for \(\theta\) is proportional to \(\theta^{a+n_{10}-1}(1-\theta)^{b+n_{01}-1}\), which is the kernel of the stated beta distribution. Similarly, the powers of \(q\) and \(1-q\) update its beta shape parameters by the discordant and concordant counts. The conditional likelihood for \(n_{10}\) also yields the beta-binomial prior predictive probability \(P(n_{10}=x\mid m)=\binom{m}{x}B(a+x,b+m-x)/B(a,b)\); after observing \(x\), the posterior is the beta distribution above.

1
Count the four pair patterns.
Check that the four counts sum to \(n\); calculate \(m=n_{10}+n_{01}\).
2
Update discordance and direction.
Add \(m\) and \(n-m\) to the prior shapes for \(q\); add \(n_{10}\) and \(n_{01}\) to the prior shapes for \(\theta\).
3
Interpret the difference.
Use \(\Delta=q(2\theta-1)\). For a continuous beta posterior on \(q\), \(q>0\) with posterior probability 1, so \(P(\Delta>0\mid\text{data})=P(\theta>1/2\mid\text{data})\).

Worked Examples

Worked Example: Posterior Evidence From Eleven Discordant Pairs

Suppose, hypothetically, that a paired trial observes \(n=40\) pairs: 8 have an event under treatment only, 3 have an event under control only, 12 have events under both, and 17 have no event under either. Use independent uniform priors \(q\sim\operatorname{Beta}(1,1)\) and \(\theta\sim\operatorname{Beta}(1,1)\).

There are \(m=8+3=11\) discordant pairs and \(n-m=29\) concordant pairs. The posterior updates are

$$ q\mid\text{data}\sim\operatorname{Beta}(1+11,1+29)=\operatorname{Beta}(12,30), \qquad \theta\mid\text{data}\sim\operatorname{Beta}(1+8,1+3)=\operatorname{Beta}(9,4). $$

The posterior probability that the treatment event probability is higher is \(P(\Delta>0\mid\text{data})=P(\theta>1/2\mid\text{data})\). For positive integer beta shapes, the beta-binomial identity gives \(P(\theta>t)=P(Y\le a-1)\) when \(\theta\sim\operatorname{Beta}(a,b)\) and \(Y\sim\operatorname{Binomial}(a+b-1,t)\). Here \(Y\sim\operatorname{Binomial}(12,0.5)\), so

$$ P(\Delta>0\mid\text{data}) =P(Y\le 8) =\frac{4096-220-66-12-1}{4096} =\frac{3797}{4096} \approx 0.9260. $$

The subtracted numerators are the binomial coefficients for \(Y=9,10,11,12\). The posterior probability of a positive treatment-minus-control event difference is about 0.926. This is posterior evidence in favor of a positive difference, not a probability that a null hypothesis is true.

The posterior means are \(E(q\mid\text{data})=12/42=0.2857\) and \(E(\theta\mid\text{data})=9/13=0.6923\). Posterior independence gives

$$ E(\Delta\mid\text{data}) =E(q\mid\text{data})\{2E(\theta\mid\text{data})-1\} =\frac{12}{42}\left(\frac{18}{13}-1\right) =\frac{10}{91} \approx 0.1099. $$

Thus the posterior mean paired event risk difference is about 0.110, or 11.0 percentage points, treatment minus control. The sign probability and posterior mean answer different questions: the first concerns the direction of the difference, while the mean also reflects the posterior frequency of discordance.

Worked Example: Few Discordances and a Different Prior

Consider hypothetical data from \(n=30\) pairs, with \(n_{10}=5\), \(n_{01}=2\), \(n_{11}=8\), and \(n_{00}=15\). Use \(q\sim\operatorname{Beta}(1,1)\) and a mildly concentrated direction prior \(\theta\sim\operatorname{Beta}(2,2)\).

Here \(m=7\), so the posterior distributions are

$$ q\mid\text{data}\sim\operatorname{Beta}(8,24), \qquad \theta\mid\text{data}\sim\operatorname{Beta}(7,4). $$

The posterior probability of a positive difference is \(P(\theta>1/2\mid\text{data})\). Apply the beta-binomial identity with \(Y\sim\operatorname{Binomial}(10,0.5)\):

$$ P(\Delta>0\mid\text{data}) =P(Y\le 6) =\frac{1+10+45+120+210+252+210}{1024} =\frac{848}{1024} =0.8281. $$

The posterior means are \(E(q\mid\text{data})=8/32=0.25\) and \(E(\theta\mid\text{data})=7/11\). Therefore

$$ E(\Delta\mid\text{data}) =\frac{8}{32}\left(\frac{14}{11}-1\right) =\frac{3}{44} \approx 0.06818. $$

The posterior mean difference is about 6.82 percentage points in the treatment-minus-control direction, with posterior probability 0.828 of a positive difference. The prior contributes two counts to each direction parameter; with only seven discordant pairs, that contribution is not negligible. Prior sensitivity should therefore be examined when discordance is sparse.

Worked Example: No Discordant Pairs

Suppose a hypothetical study observes 20 pairs, all concordant, and uses \(q\sim\operatorname{Beta}(1,1)\) and \(\theta\sim\operatorname{Beta}(1,1)\). Then \(m=0\), and the updates give

$$ q\mid\text{data}\sim\operatorname{Beta}(1,21), \qquad \theta\mid\text{data}\sim\operatorname{Beta}(1,1). $$

The discordance data update \(q\), whose posterior mean is \(1/22\approx0.04545\), but do not update \(\theta\): no discordant pair indicates which condition is more likely to have the event when outcomes differ. Under the continuous beta model \(q>0\) almost surely, and the posterior probability of a positive difference remains \(P(\theta>1/2)=0.5\). The posterior mean difference is also zero because \(E(\theta)=0.5\). These results do not prove that the population discordance probability is zero or that the two event probabilities are exactly equal.

Justification for the Sign Probability

The beta-binomial identity used in the examples can be checked directly. For positive integers \(a,b\), put \(N=a+b-1\) and define \(G(t)=\sum_{k=0}^{a-1}\binom{N}{k}t^k(1-t)^{N-k}\). This is the binomial probability \(P(Y\le a-1)\) for \(Y\sim\operatorname{Binomial}(N,t)\). Differentiating the sum and cancelling adjacent terms gives

$$ G'(t)=-\frac{t^{a-1}(1-t)^{b-1}}{B(a,b)}. $$

The beta density with parameters \(a,b\) is \(f(t)=t^{a-1}(1-t)^{b-1}/B(a,b)\), so \(G'(t)=-f(t)\). Also, \(G(0)=1\) and \(P(\theta>0)=1\). These matching derivatives and boundary values establish \(G(t)=P(\theta>t)\), including at \(t=1/2\).

This sign calculation depends on \(q>0\). Under a beta prior with positive shapes, the posterior assigns probability 1 to \(0<q<1\), so the equivalence holds. If the model instead assigned positive probability to the point \(q=0\), then \(\Delta=0\) whenever \(q=0\), and the probability \(P(\Delta>0)\) would also need to account for that point mass.

Assumptions, Diagnostics, and Alternatives

The model is useful when the pairs represent independent sampling units and when a common discordance rate and direction probability are reasonable summaries for the population. A matched pair must be defined before outcomes are analyzed, and the treatment and control labels must be consistent across pairs. In a crossover study, period effects, carryover, or changes in the participant between periods can undermine the interpretation of the paired outcomes. A paired association alone does not establish a causal treatment effect; causal interpretation depends on the design and its assumptions.

Check the four counts against the study records and verify that they sum to \(n\). Inspect \(m\), not only the total sample size: a large trial can still have little information about direction if very few pairs are discordant. If \(m=0\) or is small, the posterior for \(\theta\) will be driven substantially by its prior. Also examine whether discordance appears very different across important groups or sites. Strong heterogeneity can make a single common \(q,\theta\) model an inadequate description.

The principal alternative is to analyze the two treatment groups as if their outcomes were independent. That approach ignores the within-pair structure and generally does not estimate uncertainty appropriately for a paired design. The paired analysis uses the two discordant counts to learn direction; the independent-groups analysis uses marginal event counts and is appropriate only when the treatment and control observations are genuinely independent under the sampling design. Neither model should be chosen just because it gives a preferred result.

FeaturePaired binary modelIndependent-groups model
Observational unitPair; two linked binary outcomesOne independently observed unit per group
Information about the differenceDiscordant patterns \(n_{10}\) and \(n_{01}\)Separate event counts in each group
Key structural assumptionPairs are independent; shared \(q,\theta\) describe themObservations across groups are independent
Common failureIgnoring pairing or having too few discordancesApplying it to matched or repeated observations

A limitation is that the two-parameter factorization summarizes all paired outcomes through discordance frequency and direction. If the scientific question requires group-specific variation, covariate adjustment, or a more complex repeated-measures structure, this simple conjugate model is not sufficient. It also does not by itself provide a posterior interval for \(\Delta\); such an interval requires evaluating the posterior distribution of the product \(q(2\theta-1)\), rather than treating its two components as fixed at their means.

Common Mistakes

  • Counting concordant pairs as directional evidence. A pair with events under both conditions contributes equally to the two event probabilities. Direction is informed by \(n_{10}\) versus \(n_{01}\).
  • Calling \(q\) the direction probability. \(q\) is the probability of any discordance; \(\theta\) is the treatment-only probability conditional on discordance. They answer different questions.
  • Interpreting a high sign probability as a large effect. \(P(\Delta>0\mid\text{data})\) describes direction. The magnitude also depends on \(q\), as \(\Delta=q(2\theta-1)\).
  • Treating no observed discordances as proof of no difference. Zero discordances update \(q\) downward, but leave \(\theta\) unchanged under this model; they do not establish \(q=0\).
  • Using marginal counts while discarding the pairing. The same marginal event totals can arise from different discordant counts, which carry different information about paired differences.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions provided.

  1. A hypothetical paired dataset has \(n_{10}=6\), \(n_{01}=4\), and 30 concordant pairs. Under independent uniform beta priors for \(q\) and \(\theta\), what are the posterior distributions?
  2. In a paired study, why do pairs with events under both conditions not determine the sign of the paired event risk difference?
  3. If no discordant pairs are observed and the prior for \(\theta\) is uniform, what is the posterior probability that \(\Delta>0\) under a continuous beta prior for \(q\)? Explain.
  4. For \(\theta\mid\text{data}\sim\operatorname{Beta}(7,4)\), calculate \(P(\theta>1/2\mid\text{data})\) using the beta-binomial identity.

Solutions. (1) Here \(m=6+4=10\), with 30 concordant pairs, so \(q\mid\text{data}\sim\operatorname{Beta}(11,31)\) and \(\theta\mid\text{data}\sim\operatorname{Beta}(7,5)\). (2) Both-event pairs contribute one event to treatment and one to control; their contributions cancel in the difference. Only treatment-only and control-only pairs affect its sign. (3) The posterior for \(\theta\) is unchanged at \(\operatorname{Beta}(1,1)\); since beta-distributed \(q\) is positive almost surely, \(P(\Delta>0\mid\text{data})=P(\theta>1/2)=0.5\). (4) Let \(Y\sim\operatorname{Binomial}(10,0.5)\). Then \(P(\theta>1/2)=P(Y\le6)=(1+10+45+120+210+252+210)/1024=848/1024=0.8281\).

Clinical Biostats