Two Ways to Record the Same Binary Trials
A binary response can be stored as one zero-or-one value for each trial, or as a success count paired with the number of eligible trials. These are not automatically interchangeable data formats. They represent the same information for a specified model only when the trials being grouped have the same conditional success probability, including the same dependence on covariates and random effects.
This distinction matters in a GLMM because a success probability is usually conditional on a cluster's random effect. The relevant question is therefore not simply whether records have the same observed outcome type, but whether their conditional probabilities have the same model form. The introductory material on Bernoulli and grouped binomial likelihoods provides the component likelihoods; here the key task is to compare their representations.
Model and Conditions for Equivalence
Suppose cluster \(j\) has random-effects vector \(b_j\), with \(b_j\sim N(0,D)\), independently across clusters. A standard logistic mixed model for individual records is
Here \(\mathbf{x}_{ij}\) and \(\mathbf{z}_{ij}\) are the fixed- and random-effects design vectors. For a group of trials to share one conditional probability, the model must give them the same linear predictor for every possible value of \(b_j\). A simple sufficient condition is that all trials in the group have the same fixed- and random-effects design vectors. They must also be conditionally independent given \(b_j\), and the response must use the same defined success event for every trial.
Under those conditions, write the common conditional probability as \(p_{jg}(b_j)\). The grouped count has the conditional distribution
The conditioning is essential: the binomial probability here depends on the shared random effect. It does not generally assert that the count has an ordinary binomial distribution with one fixed probability after the random effect has been integrated out.
Worked Example: A Grouped Count Versus One Ordered Record
Suppose four hypothetical trials have the same conditional success probability, \(p=0.4\), and their observed outcomes in trial order are \(1,0,1,0\). Assume independence conditional on the model parameters. Calculate the probability of this ordered record and the probability of observing two successes among the four trials.
For the ordered Bernoulli record, multiply the four trial probabilities:
The grouped count is \(Y=2\) out of \(n=4\). Any of \(\binom{4}{2}=6\) ordered records with two successes has the same probability, so
The two probabilities answer different questions: one is for this particular ordering, and the other is for the count, regardless of ordering. The factor of six is the number of individual records represented by the grouped count.
Why the Likelihoods Match for Model Inference
For a group of \(n\) conditionally independent Bernoulli trials with common probability \(p\), let \(y\) be the observed number of successes. The probability of one particular ordered sequence containing \(y\) successes is \(p^y(1-p)^{n-y}\). There are \(\binom{n}{y}\) such sequences, and they are disjoint. Adding their probabilities gives the grouped count likelihood:
The coefficient \(\binom{n}{y}\) does not depend on the regression parameters or on \(b\). Thus, for inference about those parameters from this group, the grouped likelihood is the individual-record likelihood multiplied by a parameter-independent factor. The two likelihoods are proportional and yield the same parameter estimates when they describe the same trials and model.
The same reasoning applies in a GLMM after accounting for the random effects. For one cluster, multiplying the conditional Bernoulli probabilities and then integrating over \(b_j\) gives the individual-record marginal likelihood. If a group has common \(p_{jg}(b_j)\), the grouped conditional likelihood adds the binomial coefficient. Because that coefficient is constant in \(b_j\), it can be taken outside the integral. With several groups in a cluster, the corresponding coefficients multiply.
The integral in the second line is the individual-record marginal likelihood for the represented outcomes, up to the displayed combinatorial factor. This establishes the likelihood relationship rather than assuming that random effects leave the trials independent after marginalization.
Worked Example: Grouping Trials Within a Random-Intercept Cluster
Consider a hypothetical cluster with a random-intercept model \(\operatorname{logit}(p_j)=\beta_0+b_j\), where \(b_j\sim N(0,\sigma_b^2)\). For illustration, set \(\beta_0=0\) and condition on \(b_j=\log 2\). Three trials in this cluster share the same model terms, and the observed outcomes are \(1,1,0\). Find the conditional probability of this ordered record and the conditional probability of the count \(Y_j=2\).
First calculate the conditional probability:
The ordered record has conditional probability
There are \(\binom{3}{2}=3\) ordered records with two successes. Therefore, the grouped count probability is
These are conditional probabilities at the specified value of the random intercept. In a fitted GLMM, the random effect is not ordinarily known to equal \(\log 2\); the cluster likelihood accounts for its distribution. The calculation shows how the grouped and individual conditional likelihood contributions relate at each value of that shared effect.
Several Covariate Cells in One Cluster
A cluster need not have one probability for every trial. It can instead contain several groups, each with its own common design vectors and conditional probability. The likelihood then multiplies the binomial contributions for those groups conditional on the cluster random effect, before integrating over that effect. This preserves the shared-cluster structure: the different grouped counts are not treated as if they had unrelated random effects.
Worked Example: Two Covariate Cells and Their Likelihood Factor
Suppose a hypothetical cluster has two covariate cells. In the \(x=0\) cell there are three outcomes, \(1,0,0\); in the \(x=1\) cell there are three outcomes, \(1,1,0\). For an illustrative logistic model, set \(b_j=0\), \(\beta_0=-\log 3\), and \(\beta_1=\log 3\), with linear predictor \(\beta_0+\beta_1x+b_j\). Calculate both the individual-record likelihood and the grouped-count likelihood at these parameter values.
For \(x=0\), the linear predictor is \(-\log 3\), so \(p_0=1/(1+3)=0.25\). For \(x=1\), it is zero, so \(p_1=0.5\). The individual-record likelihood is
The grouped counts are \(y_0=1\) of \(n_0=3\) and \(y_1=2\) of \(n_1=3\). Their likelihood is
The grouped likelihood is nine times the individual-record likelihood because the two cells contribute factors \(\binom{3}{1}=3\) and \(\binom{3}{2}=3\). Both encode the same cell-specific outcomes for this model, though their probability values refer to different sample spaces.
What Is Preserved, and What to Check
When the stated conditions hold, changing representation preserves the parameter-dependent likelihood and thus the model-based estimates and inferences, provided the same model, trials, and covariate information are used. It does not make the probability of a count equal to the probability of one particular ordered record. Nor does it mean that the individual ordering remains available for analyses that use information not present in the counts.
Before using a grouped representation, check the model specification rather than relying only on a matching total number of trials. In particular, verify that:
- Each denominator counts the trials eligible for the success event, and every trial has exactly one outcome in the represented set.
- Trials in each proposed group share the same conditional linear predictor, including any random-effects terms.
- Conditional independence is appropriate given the random effects, and the grouping does not combine trials with different model predictors.
- The cluster identity is retained wherever it is needed to associate records with the same random effect.
If these conditions fail, a single binomial likelihood for the group need not reproduce the individual-record likelihood. In particular, a count that combines trials with different conditional probabilities generally does not have the binomial distribution with one common probability. Detailed treatment of how covariate variation constrains grouping belongs to the subsequent material; the practical point here is to verify the shared-probability condition before claiming equivalence.
Common Pitfalls and Alternatives
- Confusing count probability with sequence probability. The count probability includes \(\binom{n}{y}\); the probability of one ordered sequence does not. The factor counts the distinct sequences that produce the same count.
- Dropping cluster structure. A grouped record must still be attached to its cluster. If trials share \(b_j\), the grouped likelihood must use that same random effect rather than treating the count as independent of the cluster model.
- Assuming marginal independence. Conditional independence given \(b_j\) does not generally imply independence after \(b_j\) is integrated out. The shared latent effect can induce dependence among outcomes in a cluster.
- Comparing raw likelihood values across representations. The binomial coefficients change the numerical likelihood scale even when the parameter-dependent likelihood is equivalent. Likelihood comparisons should use a consistent representation; a parameter-independent factor cancels when comparing models fitted to the same representation.
- Discarding the denominator. A success count without its number of eligible trials does not specify the grouped binomial record. The denominator is part of the response representation.
Individual Bernoulli records are useful when trial-level covariates or ordering matter, while grouped binomial counts can give a compact representation when trials share the same conditional model terms. Neither format is inherently more correct: the appropriate choice depends on what was observed and which likelihood faithfully represents those observations.
Check Your Understanding
Answer each question, then check the concise solutions below.
- For \(n=5\) conditionally independent trials with common \(p=0.2\), what is the probability of one specified ordered record with two successes? What is the probability of a count of two successes?
- In a GLMM, what condition must grouped trials satisfy with respect to the random effects?
- Why does integrating over a shared cluster random effect not invalidate the likelihood equivalence?
- What information is represented by \(\binom{n}{y}\), and does it depend on regression parameters?
Solutions. (1) One specified sequence has probability \((0.2)^2(0.8)^3=0.02048\). The count probability is \(\binom{5}{2}(0.2)^2(0.8)^3=10(0.02048)=0.2048\). (2) Their conditional success probabilities must be the same function of the random effects; identical random-effects design vectors are a sufficient condition. (3) The group’s binomial coefficient is constant in the random effect, so it can be taken outside the integral; the remaining integrand matches the individual likelihood. (4) It counts the ordered sequences corresponding to the same success count, and it does not depend on regression or random-effects parameters.