Tutorials › Generalized Linear Mixed Models (GLMM) › Binary Outcomes Versus Event Counts

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

Binary Outcomes Versus Event Counts

Learn when an any-event indicator and an event count describe different responses, and how that distinction changes the GLMM target.

Intermediate 10 min read

What You'll Learn

  • Define an any-event indicator from a count recorded over the same observation window.
  • Distinguish the probability of at least one event from the expected number of events.
  • Identify the special case in which the indicator and count have equal numerical values.
  • Compare the conditional interpretations of binary-outcome and count GLMMs.
  • Check event definitions, observation windows, and recorded values before selecting a response.

One Window, Two Possible Responses

Suppose a clinic records whether each patient experienced a particular event during a 30-day follow-up. It could instead record how many times the event occurred during those same 30 days. These outcomes use the same event definition and observation window, but they answer different questions: did anything happen? versus how many times did it happen?

The distinction matters in a generalized linear mixed model (GLMM) because the response determines what the model describes. A binary model targets the conditional probability of the defined outcome. A count model targets a distribution of event counts, often summarized by a conditional mean. An indicator of any event can be calculated from the count, but it generally does not preserve all the information in that count.

Definition: Let \(C_{ij}\) be the number of events recorded for observation \(i\) in cluster \(j\) during a specified window. If the binary outcome is defined as whether at least one event occurred in that same window, set \(B_{ij}=I(C_{ij}\geq 1)\), where \(I(\cdot)\) equals 1 when its condition is true and 0 otherwise. Then \(B_{ij}\) is an indicator derived from \(C_{ij}\); it is not itself the event count.

The definition requires a clear event, observational unit, and window. For example, “at least one hospital visit per patient during 30 days” is a binary outcome, while “number of hospital visits per patient during 30 days” is a count outcome. A patient with four visits contributes \(B_{ij}=1\) to the first outcome and \(C_{ij}=4\) to the second.

The indicator and count are exactly related only if they refer to the same event, unit, and window and the indicator means “one or more.” If the binary response instead means “a severe event occurred,” it need not be derivable from the total event count. A count of several mild events does not establish that any event was severe.

What the Two Responses Measure

For a nonnegative integer count \(C_{ij}\), the indicator has two possible values, 0 and 1. Its conditional expectation is the conditional probability of at least one event. By contrast, the count can take values \(0,1,2,\ldots\), and its conditional expectation is the average number of events per observation at given covariates and random effects.

$$ E(B_{ij}\mid b_j)=P(C_{ij}\geq 1\mid b_j)=1-P(C_{ij}=0\mid b_j), \qquad E(C_{ij}\mid b_j)=\sum_{k=0}^{\infty}kP(C_{ij}=k\mid b_j). $$

Here \(b_j\) denotes the random effects for cluster \(j\). These quantities answer distinct questions. The probability concerns whether the count is zero or positive; the mean count also reflects how large positive counts can be. In general, knowing the probability of any event does not determine the expected count, and knowing the expected count alone does not determine the probability of any event.

A binary GLMM may, for example, specify \( \operatorname{logit}\{P(B_{ij}=1\mid b_j)\}=X_{ij}\beta+Z_{ij}b_j \). Its linear predictor describes the log odds of at least one event, conditional on the random effects. A count GLMM instead specifies a distribution for \(C_{ij}\), conditional on predictors and random effects; a model for its mean may use a linear predictor such as \( \log\{E(C_{ij}\mid b_j)\}=X_{ij}\beta+Z_{ij}b_j \) when that link and distribution are appropriate. The coefficients therefore refer to different response-scale quantities. A binary-model coefficient is not automatically an effect on the mean event count.

Worked Example: Converting Counts to Any-Event Indicators

In a hypothetical set of eight patient follow-up windows, the recorded numbers of events are \(0,1,0,3,0,2,1,0\). The outcome of interest is whether at least one event occurred in each window. Convert the counts to indicators and compare the observed summaries.

Applying \(B=I(C\geq1)\) gives indicators \(0,1,0,1,0,1,1,0\). Four of the eight windows had at least one event, so the observed proportion with any event is \(4/8=0.500\).

The total number of events is \(0+1+0+3+0+2+1+0=7\). The mean count is therefore \(7/8=0.875\) events per window. The two summaries are not competing calculations: 0.500 is the fraction of windows with any event, whereas 0.875 is the average number of events per window.

The count of 3 and the count of 2 each become 1 in the binary representation. The indicators retain whether a window had an event, but discard how many events occurred after the first. A model of these indicators cannot distinguish a window with one event from a window with three events.

A Relationship That Holds for Every Nonnegative Count

The exact relation between the two expected values can be established without choosing a particular count distribution. For a nonnegative integer-valued count, the indicator equals the count when the count is 0 or 1. When the count is at least 2, the count exceeds the indicator.

$$ E(C_{ij}\mid b_j)-E(B_{ij}\mid b_j) =\sum_{k=2}^{\infty}(k-1)P(C_{ij}=k\mid b_j)\geq 0. $$

To see the equality, write \(E(B_{ij}\mid b_j)=\sum_{k=1}^{\infty}P(C_{ij}=k\mid b_j)\), since the indicator is 1 exactly for positive counts. Subtract this from the count mean, \(\sum_{k=1}^{\infty}kP(C_{ij}=k\mid b_j)\). The \(k=1\) terms cancel, leaving the displayed sum for \(k\geq2\). Every term is nonnegative, so the conditional mean count is at least the conditional probability of any event.

Equality holds if and only if \(P(C_{ij}\geq2\mid b_j)=0\): given those random effects, counts can only be 0 or 1. In that special case, the count itself is numerically the binary indicator. When counts greater than 1 are possible, the conditional mean count is strictly larger whenever such counts have positive probability. This result concerns numerical values on their respective scales; it does not make a probability and an event count the same estimand.

Worked Example: Why an Any-Event Odds Ratio Is Not a Count Comparison

Consider hypothetical data from two groups, each with 100 observation windows of equal duration. In Group A, 40 windows have at least one event; in Group B, 10 windows have at least one event. Calculate the odds ratio for any event and state what it does and does not compare.

The observed any-event proportions are \(40/100=0.400\) and \(10/100=0.100\). Their odds are \(0.400/0.600\) and \(0.100/0.900\), respectively. Thus the exact ratio of the odds, using the original proportions, is

$$ \frac{0.400/0.600}{0.100/0.900} =\frac{2/3}{1/9}=6.00. $$

In these hypothetical data, the observed odds of at least one event per window are six times as large in Group A as in Group B. This comparison does not say that Group A has six times as many events per window. The supplied data give only the number of windows with any event; they do not say whether positive windows contained one event or many. Moreover, this is an observed group comparison, not evidence by itself that group membership caused an event.

A logistic GLMM for these indicators would model conditional odds of any event, with its interpretation also depending on the random-effects specification. To compare event counts, the count values themselves and an appropriate count-response model are needed. The binary data alone cannot recover that count comparison.

Choosing and Checking the Response

Before fitting a GLMM, confirm that the recorded response matches the scientific question. If the question concerns the chance of any occurrence in a defined window, the indicator is a direct response. If the question concerns event burden, frequency, or total number per window, retain the count. It may be useful to study both, but they should be stated as separate outcomes with separate interpretations.

A basic data check is to compare the count and indicator for every observation whenever both are available. The indicator should be 0 for a count of 0 and 1 for every positive count. A mismatch can signal a coding error, different window definitions, inconsistent event criteria, or missing information. Also check whether all observations have comparable windows and whether the event was observable throughout each one. A 30-day window and a 90-day window do not provide the same opportunity to record events.

If only the indicator was collected, do not describe its fitted probability as an expected number of events. The lost information cannot be recovered from the indicator. Conversely, if a count is recorded but the scientific target is any occurrence, a model of the derived indicator is possible; however, it deliberately ignores differences among positive counts.

Question of interestResponseDirect interpretation
Did at least one event occur?\(B_{ij}=I(C_{ij}\geq1)\)Conditional probability or odds of any event
How many events occurred?\(C_{ij}\)Conditional distribution or mean number of events
Both occurrence and burden matterAnalyze indicator and count as distinct outcomesSeparate results for occurrence and frequency

The response distribution and its support should be checked against the observed records and the measurement process. Indicators must be 0 or 1; counts must be nonnegative integers if they represent numbers of events. Values outside those supports point to a definition or data problem, or to a response that is not actually the stated type. For clustered observations, the GLMM also relies on its specified conditional structure: for example, the random effects represent modeled between-cluster variation, and the assumed conditional response distributions must be suitable for the response being analyzed.

Common Mistakes and Limitations

  • Calling any positive count a binary outcome without defining the threshold. “At least one event” is one threshold; “at least two” is another. State the event rule explicitly.
  • Interpreting an event probability as an event rate or mean count. A probability concerns whether an observation window has any event; it does not reveal the number of events in positive windows.
  • Assuming rare events turn a count into a Bernoulli response. Rarity does not change the recorded support. If counts above 1 remain possible and are recorded, they remain counts; a binary indicator is a deliberate recoding.
  • Combining unlike windows without accounting for their definitions. Different observation durations or exposure opportunities can change both the chance of any event and the count. The response must be interpreted in light of how it was observed.

Neither response is universally preferable. The indicator can be easier to interpret when occurrence is the target, but it loses event-frequency information. The count retains that information, but requires a count model suited to the data-generating and recording process. A binary GLMM and a count GLMM are not interchangeable alternatives that differ only in coding: they address different conditional outcomes and require different response distributions.

Worked Example: Separating Occurrence From Event Burden

A hypothetical set of five equal-length observation windows has event counts \(0,0,1,2,4\). Calculate the proportion of windows with any event, the mean count per window, and the mean count among positive windows.

The derived indicators are \(0,0,1,1,1\), so the proportion with any event is \(3/5=0.600\). The total count is \(0+0+1+2+4=7\), giving \(7/5=1.40\) events per window. Among the three positive windows, the total is still 7, so the mean count among positive windows is \(7/3=2.33\) events per positive window.

These are three distinct summaries: 0.600 describes occurrence across all windows, 1.40 describes average burden across all windows, and 2.33 describes burden conditional on a positive window in this sample. The last is a descriptive conditional average; it is not the mean count for all windows. A binary model of the indicators addresses occurrence, while a count model using the five counts can retain the differences among 1, 2, and 4 events.

Check Your Understanding

Use the stated observation window and event definition in each answer. Solutions follow the questions.

  1. One observation has a count of 3 events. What is its indicator for whether at least one event occurred, and what information is lost by using that indicator?
  2. For a nonnegative integer-valued count \(C\), when does \(E(C)=P(C\geq1)\) hold?
  3. A model estimates the probability of at least one event in a week. Can that estimate alone determine the expected number of events per week? Explain.
  4. For counts \(0,1,1,3\), calculate the proportion of windows with any event and the mean count per window.

Solutions. (1) The indicator is \(I(3\geq1)=1\). It retains the fact that an event occurred but loses the distinction between 3 events and any other positive count. (2) The equality holds if and only if counts of 2 or more have probability zero; then the count can only be 0 or 1. (3) No. The probability identifies how often counts are positive, but not how large positive counts are. (4) Three of four windows are positive, so the proportion is \(3/4=0.750\). The total is \(0+1+1+3=5\), so the mean is \(5/4=1.25\) events per window.

Clinical Biostats