Tutorials › Generalized Linear Mixed Models (GLMM) › Known Maximum Counts And The Binomial Family

Responses: Binary, Count, Ordinal, Overdispersed · Tutorial 79 of 698

Known Maximum Counts And The Binomial Family

Learn to identify a valid binomial response and specify its conditional distribution within a generalized linear mixed model.

Intermediate 10 min read

What You'll Learn

  • Identify when a count has a known maximum set by the number of eligible opportunities.
  • State the conditional binomial response model and its assumptions.
  • Derive the binomial mean and variance from individual trial indicators.
  • Use the correct denominator in grouped response data.
  • Interpret binomial probabilities and means in a GLMM with random effects.
  • Recognize when a finite upper bound does not justify a binomial family.

When a Count Has a Known Maximum

A count response may record the number of successes among a fixed number of opportunities: for example, the number of patients responding among those treated, or the number of correct answers among questions attempted. In such cases, the maximum count is meaningful because the number of opportunities is known. That structure points to the binomial family, provided the opportunities also meet the model’s assumptions.

The key is not merely that a count is bounded in the observed data. The upper bound must correspond to the number of eligible trials, and the recorded count must be the number of successes in those trials. A count of events over a period can be small in practice without having a fixed maximum set by a known number of opportunities.

Definition: For a response cell indexed by cluster \(i\) and observation \(j\), let \(n_{ij}\) be the known number of eligible opportunities and \(Y_{ij}\) the number of successes among them. A binomial response has $$ Y_{ij}\mid b_i \sim \operatorname{Binomial}(n_{ij},p_{ij}), $$ where \(p_{ij}\) is the success probability conditional on the random effects \(b_i\) and the predictors. Its possible values are \(0,1,\ldots,n_{ij}\).

In a GLMM, predictors and random effects commonly determine the conditional success probability through a link function. With the logit link, one standard specification is

$$ \operatorname{logit}(p_{ij})=\log\!\left(\frac{p_{ij}}{1-p_{ij}}\right) =\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta} +\mathbf{z}_{ij}^{\mathsf T}\mathbf{b}_i, \qquad \mathbf{b}_i\sim N(\mathbf{0},\mathbf{D}). $$

Here \(\mathbf{x}_{ij}\) and \(\mathbf{z}_{ij}\) are the fixed- and random-effect design vectors, \(\boldsymbol{\beta}\) is the vector of fixed effects, and \(\mathbf{D}\) is the random-effects covariance matrix. Conditional on the random effects, the binomial distribution describes the response. The marginal distribution, after averaging over the random-effects distribution, is generally not itself binomial with one common probability.

Assumptions Behind the Binomial Choice

The binomial model is supported when the response can be understood as the total of \(n_{ij}\) binary trial outcomes. For a given response cell, the trials must have the same conditional success probability \(p_{ij}\), and, conditional on the model’s predictors and random effects, their outcomes must be independent. The number of eligible trials must be known and fixed for that cell, or treated as fixed by the sampling design. The success event must also be defined consistently across the trials.

These assumptions do not require every cell to have the same denominator or probability. For example, different clinics can have different numbers of eligible patients, and the conditional success probabilities can vary with covariates and clinic random effects. But each cell’s denominator must refer to the actual opportunities that could have produced the successes being counted.

If trial probabilities differ within a cell, a single binomial probability may not describe the total count. Likewise, if outcomes remain dependent after conditioning on the included random effects, the binomial variance may be too small. These are modeling concerns, not reasons to change the denominator until the data fit.

Result: Under the binomial assumptions, $$ P(Y_{ij}=y\mid b_i) =\binom{n_{ij}}{y}p_{ij}^{\,y}(1-p_{ij})^{n_{ij}-y}, \qquad y=0,\ldots,n_{ij}. $$ The conditional mean and variance are $$ E(Y_{ij}\mid b_i)=n_{ij}p_{ij}, \qquad \operatorname{Var}(Y_{ij}\mid b_i)=n_{ij}p_{ij}(1-p_{ij}). $$

The binomial coefficient counts how many arrangements of \(y\) successes among \(n_{ij}\) trials produce the same total. Each such arrangement has probability \(p_{ij}^{y}(1-p_{ij})^{n_{ij}-y}\) under conditional independence and a common success probability.

Why the Binomial Mean and Variance Have This Form

A short derivation makes the role of the assumptions clear. Write each trial outcome as \(X_{ijk}\), equal to 1 for a success and 0 otherwise, for \(k=1,\ldots,n_{ij}\). Then \(Y_{ij}=\sum_{k=1}^{n_{ij}}X_{ijk}\). Conditional on the predictors and random effects, each indicator has mean \(p_{ij}\) and variance \(p_{ij}(1-p_{ij})\). Linearity of expectation gives the mean. Conditional independence makes the covariances zero, so the variances add:

$$ E(Y_{ij}\mid b_i) =\sum_{k=1}^{n_{ij}}E(X_{ijk}\mid b_i) =n_{ij}p_{ij}, $$
$$ \operatorname{Var}(Y_{ij}\mid b_i) =\sum_{k=1}^{n_{ij}}\operatorname{Var}(X_{ijk}\mid b_i) =n_{ij}p_{ij}(1-p_{ij}). $$

Thus the denominator is not just a scaling choice. It identifies how many Bernoulli opportunities contribute to the count and determines the conditional variance as well as the maximum response.

Worked Example: Probability of a Specified Success Count

Suppose a hypothetical clinic has 12 eligible patients, and a fitted model gives each patient the same conditional probability \(p=0.70\) of responding. Find the conditional probability that exactly 8 patients respond.

The response is \(Y\mid b\sim\operatorname{Binomial}(12,0.70)\), assuming the 12 eligible patient outcomes are conditionally independent and share this success probability. Therefore,

$$ P(Y=8\mid b) =\binom{12}{8}(0.70)^8(0.30)^4 =495(0.05764801)(0.0081) \approx 0.2311. $$

The model assigns about 0.231 probability to exactly 8 responses, conditional on the stated probability and random effects. The possible counts run from 0 through 12; a value above 12 is impossible under this response definition.

Choosing the Denominator From Eligibility

The denominator \(n_{ij}\) counts opportunities that could have produced the success event. It is not automatically the number approached, enrolled, scheduled, or present in a larger source population. Eligibility depends on how the trial and success event are defined. The same observed count can imply different response proportions under different eligibility rules, and only the denominator matching the actual trials supports the intended binomial likelihood.

Worked Example: Counting Only Eligible Opportunities

In a hypothetical service evaluation, 24 people were scheduled for an appointment. Three were found ineligible before the service was offered. Of the 21 eligible people who received the offer, 4 accepted it. Define success as accepting the offer among eligible people offered the service. Identify the binomial response and calculate the probability of observing 4 acceptances if the conditional acceptance probability is \(0.20\).

The denominator is 21, not 24: the three ineligible people did not have the defined opportunity to accept. Thus \(Y\mid b\sim\operatorname{Binomial}(21,0.20)\), and the observed count is \(Y=4\). Under conditional independence and a common conditional acceptance probability,

$$ P(Y=4\mid b) =\binom{21}{4}(0.20)^4(0.80)^{17} =5985(0.0016)(0.022518) \approx 0.2156. $$

The observed acceptance proportion is \(4/21\approx0.1905\). Using \(4/24\) would answer a different question—acceptances per scheduled person—and would incorrectly treat ineligible people as failed opportunities for the defined outcome.

How Random Effects Change the Probability

A random effect allows conditional success probabilities to vary across clusters, such as clinics or schools. With a random intercept, a possible model is \(\operatorname{logit}(p_{ij})=\beta_0+\beta_1x_{ij}+b_i\). For a given cluster, the value of \(b_i\) shifts the conditional log-odds and therefore changes the probability used in that cluster’s binomial distribution.

This does not change what the denominator means: \(n_{ij}\) is still the known number of eligible trials. It does mean that calculations using a particular \(b_i\) are conditional calculations. A population-average probability instead averages over the random-effects distribution; it cannot generally be obtained by simply setting the random effect to zero.

Worked Example: Conditional Count Mean in a Random-Intercept Model

Consider a hypothetical model with \(\beta_0=-1.0\), \(\beta_1=0.60\), and a cluster random intercept \(b_i=0.50\). For a cell with \(x_{ij}=1\) and \(n_{ij}=10\), calculate its conditional success probability, expected count, and count variance.

First calculate the linear predictor and transform it using the inverse logit:

$$ \eta_{ij}=-1.0+0.60(1)+0.50=0.10, \qquad p_{ij}=\frac{e^{0.10}}{1+e^{0.10}}\approx0.5250. $$

Conditional on this random intercept, the count has distribution \(Y_{ij}\mid b_i\sim\operatorname{Binomial}(10,0.5250)\). Its expected number of successes is \(10(0.5250)=5.250\), and its variance is

$$ \operatorname{Var}(Y_{ij}\mid b_i) =10(0.5250)(1-0.5250) \approx2.494. $$

These are conditional quantities for a cluster with \(b_i=0.50\). They are not a claim that the observed count must be close to 5.250, nor are they the corresponding population-average quantities.

Diagnostics, Alternatives, and Limitations

A sound family choice begins with the response definition and design, then checks whether the fitted model is compatible with the observed data. Confirm that each denominator is known, positive, and matched to eligible trials; that every count lies between 0 and its denominator; and that success means the same thing across trials in a cell. Also examine whether the fitted probabilities and residual patterns suggest systematic lack of fit. Large discrepancies between observed and model-predicted variation can indicate unmodeled heterogeneity or dependence; a binomial specification alone does not explain every source of extra variation.

The principal alternatives answer different questions. Bernoulli records retain each individual binary outcome, while a grouped binomial response records a success total and its denominator; under shared cell-level probabilities, the grouped likelihood preserves the information about those totals. An unbounded event count, with no fixed set of opportunities defining a maximum, has a different response structure. Do not select a family solely because it can assign some probability to the observed values.

A finite scale maximum by itself is insufficient evidence for a binomial response. For instance, a rating from 0 to 10 is bounded, but its values are not automatically counts of successes among 10 equivalent, independent trials. Conversely, a valid binomial response can have a small observed count; the defining feature is the known number of opportunities, not how large the count happens to be.

The binomial model also has limits. A common conditional probability and conditional independence may be unrealistic when opportunities differ substantially within a cell or remain dependent after accounting for modeled random effects. Incorrect eligibility rules, unrecorded missing outcomes, and inconsistent success definitions can also invalidate the response specification. A better-fitting numerical model cannot repair an incorrectly defined trial.

Common mistake: “The count never exceeds 20, so it must be binomial with \(n=20\).” A bound in the observed scale is not enough. The correction is to establish that 20 is the known number of eligible opportunities, that the response counts successes among them, and that the conditional trial assumptions are credible.

Check Your Understanding

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

  1. A hypothetical test has 15 questions, and a student answers 11 correctly. If each question is a trial and the model gives a common conditional probability \(p=0.60\) of a correct answer, what family describes the count? What are its mean and variance?
  2. A clinic records 6 successes among 18 eligible participants. Five additional people were screened but were ineligible for the treatment whose success is being counted. What denominator belongs in the binomial response, and why?
  3. In a binomial GLMM, why does the conditional variance have the form \(np(1-p)\), rather than just \(np\)?
  4. A response is a score from 0 to 10 on a rating scale. Is its upper bound alone enough to justify a binomial family? Explain.

Solutions. (1) The count is binomial with \(n=15\) and \(p=0.60\). Its mean is \(15(0.60)=9\) correct answers, and its variance is \(15(0.60)(0.40)=3.600\) squared answers. (2) Use \(n=18\), because only those 18 participants were eligible opportunities for the defined success event; the five screened but ineligible people could not produce that success. (3) Represent the count as a sum of independent binary indicators. Each indicator has variance \(p(1-p)\), so the \(n\) variances add to \(np(1-p)\). (4) No. A bounded rating is not necessarily a total of successes among equivalent independent opportunities. The trial interpretation and assumptions must be justified, not inferred from the numerical maximum.

Clinical Biostats