Tutorials › Generalized Linear Mixed Models (GLMM) › Random Effects and Marginal Zero Probabilities

Overdispersion and Zero Inflation · Tutorial 546 of 698

Random Effects and Marginal Zero Probabilities

Learn to distinguish conditional from population-level zero probabilities and compute the latter by integrating over random effects.

Advanced 12 min read

What You'll Learn

  • State the conditional zero probability for a zero-inflated Poisson GLMM.
  • Derive its population-level form by integrating over the random-effects distribution.
  • Compute marginal zero probabilities for discrete and continuous random effects.
  • Use convexity to compare a mixed-model zero probability with a plug-in calculation.
  • Identify assumptions and diagnostics relevant to marginal zero-probability predictions.

Why Random Effects Change the Zero Probability

In a zero-inflated count model, an observed zero can arise from either the structural-zero process or the count process. In a GLMM, the count rate also varies with latent random effects. Consequently, a population-level zero probability must average over both sources of variation: first account for the mixture at each random-effect value, then average that conditional probability over the random-effects distribution.

This distinction matters when the prediction concerns a new member of the modeled population whose random effect is unknown. A prediction conditional on a particular known or estimated random effect answers a different question. Also, substituting an average count rate into a Poisson zero-probability formula generally does not reproduce the average zero probability.

Definition: Fix covariates \(x\). Let \(B\) be a random effect with distribution \(G\), let \(\pi(x)\) be the probability of a structural zero, and let \(\lambda(x,b)>0\) be the Poisson rate when the count process is active. Assume \(\pi(x)\) does not depend on \(B\). Conditional on \(B=b\), the outcome \(Y\) is zero with probability \(\pi(x)\); otherwise \(Y\) follows a Poisson distribution with rate \(\lambda(x,b)\). The population-level zero probability at \(x\) is \(P(Y=0\mid x)\) after averaging over \(B\sim G\).

The definition holds under a specified conditional model: the non-structural count is Poisson given the random effects, the structural-zero probability is correctly specified, and the random-effects distribution \(G\) is the one relevant to the target population. For example, a common log-rate specification is \(\lambda(x,b)=\exp(x^\mathsf{T}\beta+z^\mathsf{T}b)\), where \(x\) and \(z\) are covariate vectors. The derivation below only requires a positive rate function; it does not require this particular link.

Deriving the Population-Level Probability

At a fixed value \(b\), a structural zero occurs with probability \(\pi(x)\). If the structural-zero state does not apply, the Poisson count is zero with probability \(\exp\{-\lambda(x,b)\}\). The two ways of obtaining zero are disjoint, so the conditional probability is their sum, with the count-process probability weighted by the chance that the structural-zero state does not apply.

$$ P(Y=0\mid x,B=b) = \pi(x)+\{1-\pi(x)\}\exp\{-\lambda(x,b)\}. $$

To obtain the probability for a randomly selected member of the population at covariate value \(x\), apply the law of total probability and integrate the conditional probability over \(G\). Since \(\pi(x)\) is constant with respect to \(b\), it can be taken outside the integral.

$$ \begin{aligned} P(Y=0\mid x) &=\int P(Y=0\mid x,B=b)\,dG(b)\\ &=\int \left[\pi(x)+\{1-\pi(x)\}\exp\{-\lambda(x,b)\}\right]dG(b)\\ &=\pi(x)+\{1-\pi(x)\} \int \exp\{-\lambda(x,b)\}\,dG(b). \end{aligned} $$

The integral is the population-average probability that the Poisson component produces zero. It is not generally the Poisson zero probability evaluated at an average rate. If the structural-zero probability itself varies with the random effect, say it is \(\pi(x,b)\), the general expression is instead \(\int[\pi(x,b)+\{1-\pi(x,b)\}\exp\{-\lambda(x,b)\}]\,dG(b)\). Both components must then be integrated together.

Key result: With a structural-zero probability fixed at \(x\), the population-level zero probability is the structural-zero probability plus the probability of entering the count process multiplied by its random-effects-averaged zero probability. The average is taken over the random-effects distribution, not over observed zero outcomes.

Worked Calculations

Worked Example: Two Possible Random-Effect Values

Suppose a hypothetical population has \(\pi(x)=0.20\). The random effect takes two equally likely values, producing Poisson rates \(0.5\) and \(2\). Find the population-level zero probability.

The two conditional zero probabilities are \(0.20+0.80\exp(-0.5)\) and \(0.20+0.80\exp(-2)\). Averaging these gives

$$ \begin{aligned} P(Y=0\mid x) &=\frac{1}{2}\left[0.20+0.80\exp(-0.5)\right] +\frac{1}{2}\left[0.20+0.80\exp(-2)\right]\\ &=0.20+0.80\left\{\frac{\exp(-0.5)+\exp(-2)}{2}\right\}\\ &=0.20+0.80\left\{\frac{0.6065307+0.1353353}{2}\right\}\\ &=0.20+0.80(0.3709330)\\ &=0.4967464\approx 0.4967. \end{aligned} $$

Thus, among population members with these covariates, the model assigns about 49.67% probability to an observed zero. The calculation uses unrounded exponential values for the final result; rounding intermediate conditional probabilities too early can alter the last reported digit.

Worked Example: Integrating a Normal Random Effect

Consider a hypothetical model with \(B\sim N(0,0.25)\), rate \(\lambda(B)=\exp(B)\), and structural-zero probability \(\pi=0.15\). The integral \(E[\exp\{-\exp(B)\}]\) has no elementary closed form. Approximate it using three-point Gauss-Hermite quadrature for a standard normal variable: nodes \(0,\sqrt{3},-\sqrt{3}\) with weights \(2/3,1/6,1/6\). Because \(B=0.5Z\) for \(Z\sim N(0,1)\), the corresponding \(B\)-nodes are \(0\) and \(\pm0.8660\).

At these nodes the rates are approximately \(1\), \(2.377\), and \(0.4206\). The quadrature approximation to the count-process zero probability is

$$ \begin{aligned} E[\exp\{-\exp(B)\}] &\approx \frac{2}{3}\exp(-1) +\frac{1}{6}\exp(-2.377) +\frac{1}{6}\exp(-0.4206)\\ &\approx \frac{2}{3}(0.3679)+\frac{1}{6}(0.0928)+\frac{1}{6}(0.6565)\\ &\approx 0.3701. \end{aligned} $$

Therefore the population-level zero probability is approximately

$$ P(Y=0)\approx 0.15+0.85(0.3701)=0.4646. $$

This is a numerical integration result, not an exact identity. In an analysis, quadrature accuracy should be checked by increasing the number of nodes or comparing with a sufficiently precise simulation-based integral.

Worked Example: Unequal Probabilities Across Latent Settings

Suppose a hypothetical random-effects distribution assigns probabilities \(0.20\), \(0.50\), and \(0.30\) to count rates \(0.5\), \(1\), and \(3\), respectively, while \(\pi=0.10\). Calculate the population-level zero probability and separate its two contributions.

First average the Poisson zero probabilities using the given weights:

$$ \begin{aligned} E[\exp(-\Lambda)] &=0.20\exp(-0.5)+0.50\exp(-1)+0.30\exp(-3)\\ &=0.20(0.6065307)+0.50(0.3678794)+0.30(0.0497871)\\ &=0.1213061+0.1839397+0.0149361\\ &=0.3201820. \end{aligned} $$

The structural-zero contribution is \(0.10\). The count-process contribution to the probability of zero is \((1-0.10)(0.3201820)=0.2881638\). Hence

$$ P(Y=0)=0.10+0.2881638=0.3881638\approx 0.3882. $$

Of all zeros predicted by this model, the structural component represents approximately \(0.10/0.3881638=0.2576\), or 25.76%. This is a model-based decomposition of the population probability, not a way to identify with certainty the source of any particular observed zero.

Why Plugging In an Average Rate Fails

A tempting shortcut is to find the mean rate \(E(\Lambda)\) and calculate \(\exp\{-E(\Lambda)\}\). That gives the zero probability for a Poisson variable with the mean rate, but it does not generally give the average zero probability across random effects. The function \(f(\lambda)=\exp(-\lambda)\) is strictly convex for \(\lambda\geq0\), because \(f''(\lambda)=\exp(-\lambda)>0\). Jensen's inequality therefore gives

$$ E[\exp(-\Lambda)]\geq \exp\{-E(\Lambda)\}. $$

When the rate has finite mean and \(\pi\) is fixed, this implies

$$ P(Y=0\mid x) \geq \pi(x)+\{1-\pi(x)\}\exp\{-E(\Lambda\mid x)\}. $$

The inequality is strict when \(\Lambda\) is non-degenerate. Thus, at the same mean rate, rate heterogeneity increases the count-process probability of zero relative to a single Poisson rate. This result does not say that every random-effects model predicts more zeros than every model without random effects: the comparison requires the same structural-zero probability and the same mean count rate.

Assumptions, Diagnostics, and Alternatives

The integration formula is only as credible as the conditional model and the distribution being integrated. In particular, it assumes the stated Poisson count distribution conditional on the random effects, a correctly specified structural-zero probability, and a suitable random-effects distribution. A misspecified rate link or random-effects tail can materially change the average of \(\exp\{-\lambda(x,B)\}\), even when predictions at typical random-effect values look reasonable.

For a fitted model, compare observed zero frequencies with predicted population-level zero probabilities for relevant covariate patterns or groups. Predictions should integrate over the random-effects distribution for the target population. A prediction conditional on an estimated group effect is useful for that group, but it does not replace the population-level calculation for a new group. Large systematic discrepancies between observed and predicted zero frequencies are a warning to examine the conditional count distribution, structural-zero component, covariates, and random-effects assumptions; they do not by themselves identify which assumption failed.

Numerical integration is also part of the calculation, not a cosmetic detail. Check quadrature convergence or simulation precision, particularly when the rate changes sharply over the random-effects distribution. Extremely large rates contribute values near zero to the integral, whereas very small rates contribute values near one; both regions can matter to the average. Parameter uncertainty should also be considered when reporting fitted population probabilities.

The main alternatives answer different questions. A conditional prediction fixes the random effect rather than averaging it. A model without random effects uses a single rate for each covariate pattern and omits latent heterogeneity. Either may be appropriate for a particular goal, but neither is interchangeable with a population-level GLMM prediction. The integration also does not establish that structural zeros are scientifically distinct from zeros generated by the count process; that interpretation depends on the model and study context.

Common Mistake

Pitfall: “The average rate is \(1.25\), so the count-process zero probability is \(\exp(-1.25)\); I can use that as the population average.” This substitutes a rate before applying a nonlinear function. The required quantity is \(E[\exp(-\Lambda)]\), which is generally not \(\exp\{-E(\Lambda)\}\). Integrate the conditional zero probability over the random-effects distribution, then combine it with the structural-zero probability.

Check Your Understanding

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

  1. With fixed \(\pi=0.25\), suppose the random-effects distribution gives equal probability to rates \(0.8\) and \(2.4\). Calculate the population-level zero probability.
  2. If \(\pi=0.10\) and \(E[\exp\{-\lambda(x,B)\}]=0.30\), find the total zero probability and its structural and count-process contributions.
  3. State the direction of the Jensen inequality comparing the average Poisson zero probability with the zero probability at the mean rate. When is the inequality strict?
  4. In the first question, a member of a known latent group has rate \(0.8\). What is that member's conditional zero probability, and why is it not the population-level probability?

Solutions. (1) \(0.25+0.75\{[\exp(-0.8)+\exp(-2.4)]/2\}=0.25+0.75[(0.449329+0.090718)/2]\approx0.4525\). (2) The total is \(0.10+0.90(0.30)=0.370\); the contributions are \(0.10\) structural and \(0.270\) from the count process. (3) \(E[\exp(-\Lambda)]\geq\exp\{-E(\Lambda)\}\), with strict inequality for a non-degenerate rate distribution. (4) The conditional probability is \(0.25+0.75\exp(-0.8)\approx0.5870\). It conditions on one specified rate, whereas the population-level probability averages over both possible rates and is approximately \(0.4525\).

Clinical Biostats