From Individual Outcomes to a Grouped Success Count
A binary record describes one trial: its outcome is either a success or a failure. In some data sets, the recorded outcome is instead the number of successes among a known number of trials. For example, a laboratory might report that 6 of 10 hypothetical specimens met a specified criterion. The response for that group is the count 6, and the trial total is 10. Keeping both quantities makes clear what probability model the count can follow.
In a generalized linear mixed model, the success probability may depend on covariates and on a cluster-specific random effect. The grouped response then has a binomial distribution conditional on those quantities. This conditional qualification matters: the trials in a group must share a success probability once the model’s covariates and random effects are specified.
A common GLMM specification uses a link function to model the conditional probability. For a logit link, for example,
Here \(x_{ij}\) and \(z_{ij}\) are covariate vectors, \(\beta\) is a vector of fixed-effect coefficients, and \(b_i\) is the random-effect vector for cluster \(i\). The link model determines the probability; the binomial distribution specifies how the observed count varies around it. In particular, conditional on \(b_i\), the binomial mean and variance are \(m_{ij}p_{ij}(b_i)\) and \(m_{ij}p_{ij}(b_i)\{1-p_{ij}(b_i)\}\).
Why the Binomial Likelihood Has a Combination Term
Suppose there are \(m\) independent trials and each has the same conditional success probability \(p\). Any one particular sequence containing \(y\) successes and \(m-y\) failures has probability \(p^y(1-p)^{m-y}\). But the response records the count, not the order of outcomes. There are \(\binom{m}{y}\) different sequences with exactly \(y\) successes, so their probabilities add.
This is the binomial probability mass function and, viewed as a function of \(p\), the likelihood contribution of one grouped count. The factor \(\binom{m}{y}=m!/\{y!(m-y)!\}\) is part of the probability. It does not depend on model parameters when \(m\) and \(y\) are observed, so it can be dropped when finding some parameter estimates, but it must be included to write the full likelihood or calculate the probability of the observed count.
Worked Example: Likelihood for One Group
Suppose a hypothetical group has \(m=8\) trials, of which \(y=3\) are successes. Assume the trials are conditionally independent and have the same specified success probability \(p=0.40\). Find the probability of observing exactly three successes.
There are \(\binom{8}{3}=56\) ways for three of the eight trials to be successes. Therefore,
Thus the likelihood contribution at \(p=0.40\) is approximately \(0.2787\). The assumptions are explicit here: the total of eight trials is known, each trial has the same probability \(0.40\), and the trial outcomes are independent under that probability model. If those conditions do not hold, this binomial calculation is not justified merely because the data are reported as a success count.
Conditional Likelihood in a GLMM
For a GLMM, each group’s success probability can depend on its covariates and the random effect of its cluster. Conditional on the random effects, the grouped-count likelihood is a product of binomial probability mass functions, provided the trial outcomes are conditionally independent and the relevant probability is shared within each group. If clusters are independent, integrating over each cluster’s random-effect distribution gives the marginal likelihood.
Here \(f(b_i;\Sigma)\) is the random-effect density, with distributional parameters denoted by \(\Sigma\). The inner product is the likelihood conditional on the cluster’s random effect; the integral averages that likelihood over the random-effect distribution. Groups in the same cluster can therefore be dependent marginally, even though their trial outcomes are conditionally independent given the shared random effect.
Worked Example: A Group Count at a Specified Random Effect
Consider one hypothetical cluster and one group with \(m=10\) trials and \(y=6\) successes. Suppose a logit model gives a fixed-effect contribution of \(-0.70\) and the specified cluster random intercept is \(0.70\). Compute the group’s conditional likelihood contribution at these values.
The linear predictor is \(\eta=-0.70+0.70=0\), so the conditional success probability is
The count likelihood conditional on this random intercept is
The conditional likelihood contribution is approximately \(0.2051\). This is not yet the marginal likelihood contribution for the cluster: that would require integrating over the random-intercept distribution rather than treating \(b_i=0.70\) as fixed. The calculation assumes the ten trials have a common conditional probability at the stated covariates and random effect.
Worked Example: Multiplying Conditional Contributions Across Groups
Suppose a hypothetical cluster contains two groups. Conditional on a specified random effect, the first group has \(m_1=4\), \(y_1=1\), and \(p_1=0.25\); the second has \(m_2=6\), \(y_2=4\), and \(p_2=0.50\). Assume the trial outcomes in the two groups are conditionally independent. Find the joint conditional likelihood contribution.
For the first group,
For the second group,
Conditional independence gives the product:
The joint conditional likelihood is approximately \(0.09888\). It is conditional because the two probabilities were specified at a particular random effect; a marginal calculation would average the joint contribution over the random-effect distribution.
Assumptions, Diagnostics, and Alternatives
The grouped binomial likelihood is appropriate when the response is a success count from a known number of trials and, conditional on the model terms, the trials in a group are independent with a common success probability. The count must be an integer between zero and its trial total. A GLMM can represent modeled dependence across groups in a cluster through shared random effects, but the binomial specification still requires its within-group conditions conditional on those effects.
Check the data and model specification before interpreting fitted results. Confirm that every count satisfies \(0\leq y_{ij}\leq m_{ij}\), and verify that the recorded denominator really is the number of trials represented by that count. Then consider whether a common conditional probability within each group is plausible and whether the random effects and covariates capture the dependence structure relevant to the model. Systematic residual patterns or substantially greater variability than the fitted model predicts can indicate that the binomial assumptions or the broader model are inadequate; they do not, by themselves, identify a single cause.
The main alternative response representation for binary outcomes is an individual Bernoulli record, in which each trial is recorded separately as zero or one. The grouped binomial response records a count and its known trial total. These forms answer different data-recording needs; neither makes the assumptions disappear. A count with an unknown or incorrectly defined trial total cannot be given a valid grouped binomial likelihood simply by choosing a binomial family. Also, a binomial likelihood is not appropriate if trials in a group have materially different conditional success probabilities or unmodeled dependence.
A further limitation is that the binomial variance is tied to its conditional mean through \(mp(1-p)\). If that variation does not describe the data after accounting for the model structure, standard likelihood-based uncertainty estimates and inferences may be unreliable. The appropriate response is to investigate the source of mismatch and the model assumptions, not to assume that every grouped count is binomial merely because it has a maximum possible value.
Specify what constitutes one trial, what counts as a success, the integer count \(y_{ij}\), and the known total \(m_{ij}\).
Use covariates and random effects to define \(p_{ij}(b_i)\), and check that a common probability and conditional independence are reasonable within each group.
Use \(\binom{m_{ij}}{y_{ij}}p_{ij}(b_i)^{y_{ij}}\{1-p_{ij}(b_i)\}^{m_{ij}-y_{ij}}\), then combine groups and integrate over random effects when forming the marginal likelihood.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A hypothetical group has 12 trials and 5 successes. What are its grouped response and trial total?
- For \(m=5\), \(y=0\), and \(p=0.20\), calculate the binomial likelihood contribution.
- Why does a grouped binomial likelihood include \(\binom{m}{y}\)?
- What does conditioning on a cluster random effect accomplish when writing a grouped-count likelihood?
Solutions. (1) The response is the success count \(y=5\), and the known trial total is \(m=12\). (2) \( \binom{5}{0}(0.20)^0(0.80)^5=1(1)(0.32768)=0.3277\). (3) There are \(\binom{m}{y}\) distinct trial-outcome sequences containing exactly \(y\) successes, and their probabilities add to give the probability of the count. (4) Conditioning specifies the cluster-specific probability and makes the trial independence assumption explicit; the marginal likelihood is obtained by integrating the conditional likelihood over the random-effect distribution.