Tutorials › Generalized Linear Models › Unequal Trial Counts and Beta-Binomial Dispersion

Negative-Binomial and Beta-Binomial · Tutorial 730 of 981

Unequal Trial Counts and Beta-Binomial Dispersion

Learn why larger trial groups can reveal beta-binomial overdispersion, and when a design provides little information to separate dispersion from the mean.

Advanced 11 min read

What You'll Learn

  • Express beta-binomial dispersion through the within-group intraclass correlation.
  • Derive how group trial totals enter the variance and pairwise success dependence.
  • Compare designs with equal total trials but different group sizes.
  • Recognize why singleton groups cannot identify beta-binomial dispersion.
  • Diagnose design features that can make mean and overdispersion difficult to separate.

Why Trial Counts Matter

In grouped binary data, a group’s trial total is more than a bookkeeping detail. It determines how many pairs of outcomes are observed within that group, and those pairs carry information about the dependence induced by beta mixing. A collection of groups with many trials each can therefore reveal overdispersion in a way that the same total number of trials split across singletons cannot.

This tutorial focuses on that design implication. It does not treat a larger trial count as an automatic guarantee of precise dispersion estimation: the number of independent groups, the mean model, and the pattern of trial totals also matter. The key is to understand which aspects of the data can respond to dispersion at all.

Model and the Role of Group Size

For group \(i\), let \(m_i\) be its number of trials and \(Y_i\) its number of successes. In the beta-binomial model, a group has a latent success probability \(P_i\), and, conditional on that probability, its trials are binomial. Use the mean-correlation parameterization established for this model: the group mean is \(\mu_i\), and the within-group intraclass correlation is \(\rho\).

Definition: For \(0<\mu_i<1\) and concentration \(\kappa>0\), the beta-binomial model is $$ P_i\sim \operatorname{Beta}(\kappa\mu_i,\kappa(1-\mu_i)),\qquad Y_i\mid P_i\sim \operatorname{Bin}(m_i,P_i). $$ The marginal mean of a trial is \(\mu_i\), and the common intraclass correlation is \(\rho=1/(\kappa+1)\), so \(0<\rho<1\). Groups are assumed independent. The binomial model is the limiting case \(\rho=0\).

The trials within a group share \(P_i\); they are not marginally independent when \(\rho>0\). The number of within-group pairs is \(\binom{m_i}{2}=m_i(m_i-1)/2\). This number is zero for a singleton and grows quadratically with \(m_i\). That simple count is central to understanding which designs can distinguish beta-binomial dispersion from ordinary binomial variation.

Variance and Pairwise Dependence

Write \(X_{ij}\) for the success indicator on trial \(j\) in group \(i\), so \(Y_i=\sum_{j=1}^{m_i}X_{ij}\). Conditional on \(P_i\), each indicator has mean \(P_i\), and distinct indicators are conditionally independent. Marginally, each has mean \(\mu_i\). The next derivation shows precisely how the group size magnifies the effect of correlation.

Result: Under the beta-binomial model, $$ E[Y_i]=m_i\mu_i,\qquad \operatorname{Var}(Y_i)=m_i\mu_i(1-\mu_i)\{1+(m_i-1)\rho\}. $$ For distinct trials \(j\ne k\) in the same group, $$ \operatorname{Cov}(X_{ij},X_{ik})=\rho\mu_i(1-\mu_i). $$

Derivation. The beta distribution has mean \(E[P_i]=\mu_i\) and variance \(\operatorname{Var}(P_i)=\mu_i(1-\mu_i)/(\kappa+1)=\rho\mu_i(1-\mu_i)\). By conditional expectation, \(E[X_{ij}]=E[P_i]=\mu_i\). By the law of total variance,

$$ \operatorname{Var}(X_{ij}) =E[P_i(1-P_i)]+\operatorname{Var}(P_i) =\mu_i(1-\mu_i). $$

For two distinct trials, conditional independence gives \(E[X_{ij}X_{ik}\mid P_i]=P_i^2\), and hence

$$ \operatorname{Cov}(X_{ij},X_{ik}) =E[P_i^2]-E[P_i]^2 =\operatorname{Var}(P_i) =\rho\mu_i(1-\mu_i). $$

Summing the \(m_i\) indicator variances and the \(m_i(m_i-1)\) ordered covariance terms gives the stated variance:

$$ \operatorname{Var}(Y_i) =m_i\mu_i(1-\mu_i)+m_i(m_i-1)\rho\mu_i(1-\mu_i) =m_i\mu_i(1-\mu_i)\{1+(m_i-1)\rho\}. $$

Thus the binomial variance is multiplied by \(1+(m_i-1)\rho\). A larger group has more covariance terms contributing to the variance of its total. This describes a marginal variance relationship; it is not, by itself, a formula for the exact statistical information in a group.

Worked Example: The Same Mean With Different Trial Totals

Suppose two groups have the same success probability mean \(\mu=0.4\) and common correlation \(\rho=0.2\). Compare a group with \(m=1\) to a group with \(m=5\).

For the singleton, \(E[Y]=1(0.4)=0.4\), and $$\operatorname{Var}(Y)=1(0.4)(0.6)\{1+0(0.2)\}=0.24.$$ This is exactly its binomial variance: with one trial, there is no within-group pair to be correlated.

For the group of five, \(E[Y]=5(0.4)=2\), and $$\operatorname{Var}(Y)=5(0.4)(0.6)\{1+4(0.2)\}=1.2(1.8)=2.16.$$ The binomial variance with the same mean is \(5(0.4)(0.6)=1.2\). The extra variance is \(2.16-1.2=0.96\).

There are \(\binom{5}{2}=10\) within-group pairs, each with covariance \(0.2(0.4)(0.6)=0.048\). Their contribution to the variance of the total is \(2(10)(0.048)=0.96\), matching the excess variance. The factor of 2 appears because the variance of a sum includes both covariance terms for each unordered pair.

Pair Counts as a Design Diagnostic

The same dependence can be expressed through a second factorial moment. This gives a direct way to see why groups of size one do not respond to dispersion, and why larger groups supply more within-group comparisons. For \(m_i\ge 2\), define the within-group pair proportion \(T_i=Y_i(Y_i-1)/\{m_i(m_i-1)\}\).

Result: If \(m_i\ge 2\), then $$ E[T_i]=E[P_i^2]=\mu_i^2+\rho\mu_i(1-\mu_i). $$ Consequently, relative to the binomial pair expectation \(\mu_i^2\), the beta-binomial increment is \(\rho\mu_i(1-\mu_i)\).

Proof. Given \(P_i\), the quantity \(Y_i(Y_i-1)\) counts ordered pairs of distinct successful trials. There are \(m_i(m_i-1)\) ordered pairs, and each is successful with conditional probability \(P_i^2\). Therefore,

$$ E[Y_i(Y_i-1)\mid P_i]=m_i(m_i-1)P_i^2. $$

Taking expectations and dividing by \(m_i(m_i-1)\) yields \(E[T_i]=E[P_i^2]\). Since \(E[P_i^2]=\operatorname{Var}(P_i)+E[P_i]^2\), substituting the beta mean and variance gives \(E[T_i]=\mu_i^2+\rho\mu_i(1-\mu_i)\). When \(m_i=1\), the denominator is zero because there are no distinct trial pairs; the data from that group cannot supply this pair-based contrast. \(\square\)

Worked Example: Equal Total Trials, Unequal Group Sizes

Compare two designs with eight trials in total. Design A has four independent groups of size 2. Design B has one group of size 8. Assume \(\mu=0.5\) and \(\rho=0.1\) in both designs. Count the within-group pairs and calculate the expected total of \(Y_i(Y_i-1)\).

In Design A, each group contributes \(2(2-1)=2\) ordered pairs, so the total is \(4(2)=8\) ordered pairs, or four unordered pairs. For one size-2 group, $$E[Y_i(Y_i-1)]=2(0.25+0.1(0.25))=2(0.275)=0.55.$$ Across four independent groups, the expected total is \(4(0.55)=2.2\). Under the binomial model, it would be \(4\{2(0.25)\}=2\), an increment of \(0.2\).

In Design B, there are \(8(7)=56\) ordered pairs, or 28 unordered pairs. The expected factorial count is $$E[Y(Y-1)]=8(7)(0.275)=56(0.275)=15.4.$$ Under the binomial model, it would be \(56(0.25)=14\), an increment of \(1.4\).

Both designs have eight trials, but the second has seven times as many within-group pairs (56 rather than 8), and its expected factorial-count increment is seven times as large. This comparison shows design leverage for detecting pair dependence, not a sevenfold guarantee about estimator precision: the two designs also differ in their number of independent groups, and the full distribution matters.

When Mean and Dispersion Are Weakly Distinguished

The mean and dispersion affect the data in different ways. The mean primarily determines the expected number of successes, \(m_i\mu_i\). Dispersion changes the dependence among trials and inflates the variance by the factor \(1+(m_i-1)\rho\). A design can separate these patterns only if it contains observations that respond to the dependence, and if the mean structure is sufficiently constrained to interpret the observed variation.

Singleton groups are the clearest limiting case. For \(m_i=1\), integrating out \(P_i\) leaves a Bernoulli outcome with success probability \(\mu_i\). Its distribution contains no \(\rho\). Thus, even a very large number of independent singleton groups can inform their mean parameters but cannot identify beta-binomial dispersion. A design with mostly singletons and only a few repeated-trial groups may have some dispersion information, but that information rests on those few groups.

Worked Example: Singleton Groups and One Repeated Group

Suppose there are 99 groups of size 1 and one group of size 2, all with \(\mu=0.5\) and common \(\rho=0.2\). For each singleton, \(P(Y=1)=0.5\) and \(P(Y=0)=0.5\), regardless of \(\rho\). The 99 singleton outcomes therefore have no direct distributional contrast between different values of \(\rho\).

For the size-2 group, \(P(Y=2)=E[P_i^2]=\mu^2+\rho\mu(1-\mu)=0.25+0.2(0.25)=0.30\). By symmetry, \(P(Y=0)=0.30\), leaving \(P(Y=1)=1-0.30-0.30=0.40\). Under the binomial model with the same mean, these probabilities are \(0.25, 0.50, 0.25\) for \(Y=2,1,0\), respectively. The repeated group can respond to dispersion, but it supplies only one realized size-2 group. The large singleton count does not replace a shortage of repeated groups.

Even when groups have at least two trials, the variance relationship shows how uncertainty about the mean can complicate interpretation. For \(m>1\), write \(v=\operatorname{Var}(Y)\). If the mean \(\mu\) is not known, solving this variance equation for \(\rho\) gives

$$ \rho=\frac{v/\{m\mu(1-\mu)\}-1}{m-1}. $$

The same observed variance can therefore suggest different dispersion values when the mean is changed. This is a source of weak separation in small or unbalanced data sets, especially when a flexible mean model leaves little stable information about \(\mu_i\) in the groups that have repeated trials. It does not mean that mean and dispersion are always mathematically unidentifiable: their full probability distributions can distinguish them under suitable designs and assumptions.

Worked Example: A Mean Change Can Alter the Variance Interpretation

Consider groups of size \(m=4\) and an observed variance value \(v=1.20\). If the mean is taken to be \(\mu=0.5\), the binomial variance is \(4(0.5)(0.5)=1\), so the variance equation implies $$\rho=\frac{1.20/1-1}{3}=\frac{0.20}{3}\approx 0.067.$$

If instead the mean is \(\mu=0.4\), the binomial variance is \(4(0.4)(0.6)=0.96\), and the same \(v\) implies $$\rho=\frac{1.20/0.96-1}{3}=\frac{1.25-1}{3}\approx 0.083.$$

These are not two fitted models or a likelihood comparison; they simply evaluate the variance identity at two possible means. They show why the mean must be adequately learned from the data before a variance excess can be attributed to dispersion.

Design Principles and a Common Pitfall

When planning or describing grouped data, inspect the distribution of the \(m_i\), not just the total number of trials. Useful summaries include the number of singleton groups, the number of groups with at least two trials, and the total within-group pair count \(\sum_i m_i(m_i-1)/2\). Also check whether the repeated-trial groups cover the covariate patterns needed to estimate the mean model. If only one part of the covariate range has repeated trials, mean differences and dispersion may be difficult to disentangle in practice.

A common mistake is to assume that equal total trial counts imply equal opportunity to learn dispersion. For example, eight trials split into four groups of two are not equivalent, for this purpose, to eight singleton groups. The first design has four within-group pairs; the second has none. Conversely, another mistake is to treat pair count as an exact measure of precision. Pair count indicates where dispersion can affect the data, but it does not account for dependence among pair contributions, the number of independent groups, the mean model, or the complete outcome distribution.

Key takeaway: Beta-binomial dispersion acts through shared within-group probabilities. Groups with more trials create more within-group pairs, while singleton groups contain no dispersion contrast. Unequal trial totals therefore shape the design’s ability to separate mean from overdispersion, but pair counts are a diagnostic rather than a complete measure of inferential precision.

Check Your Understanding

Answer these questions using the group-level structure, not just the total number of trials.

  1. Why does a singleton group have a beta-binomial marginal distribution that is independent of \(\rho\)?
  2. For a group of size \(m\), how many unordered within-group trial pairs are there?
  3. At fixed \(\mu\) and \(\rho\), explain how the variance of the group total differs from its binomial variance.
  4. Two designs each have 12 trials: one has six groups of size 2, and the other has three groups of size 4. Compare their total numbers of within-group pairs.
  5. Why is the total number of within-group pairs useful for design assessment but not, by itself, an exact measure of dispersion-estimator precision?
Clinical Biostats