Tutorials › Generalized Linear Mixed Models (GLMM) › Marginal Rate Ratios For Count Outcomes

Marginal Effects and Population-Averaged Estimates · Tutorial 420 of 698

Marginal Rate Ratios For Count Outcomes

Learn how random-effect variation changes marginal count rates and when a population-averaged rate ratio agrees with, or differs from, its conditional counterpart.

Advanced 12 min read

What You'll Learn

  • Define a population-averaged count rate by integrating a conditional mean over the random-effects distribution.
  • Derive the lognormal multiplier for rates under a normal random intercept.
  • Explain why a random intercept alone does not change the rate ratio.
  • Calculate how random-slope variance and covariance alter a marginal rate ratio.
  • Keep exposure-adjusted rates distinct from expected counts.
  • Identify assumptions and diagnostics relevant to marginal rate-ratio calculations.

Why a Count Rate Ratio Can Depend on the Scale

In a count GLMM with a log link, a fixed-effect coefficient often has a simple conditional interpretation: exponentiating it gives a rate ratio for units with the same random effects. A population-averaged comparison asks a different question. It compares expected rates after averaging over the random-effects distribution. These two ratios need not agree, particularly when the model contains random slopes.

The distinction matters when the scientific comparison concerns rates in a population of clusters rather than a comparison at a specified cluster effect. The calculations below hold other covariates fixed and average over the same random-effects distribution at each covariate setting. They do not average over a distribution of covariates.

Definition: A conditional rate is the expected count per exposure unit at specified covariates and specified random effects. A marginal rate is the expected count per exposure unit at specified covariates, averaged over the random-effects distribution. A marginal rate ratio compares two such marginal rates. In each case, the exposure unit must be defined consistently.

Random-Intercept Model: The Averaging Multiplier Cancels

Suppose cluster \(j\) has a count \(Y_{ij}\) and exposure \(E_{ij}>0\). A Poisson random-intercept model with a log link can be written

$$ Y_{ij}\mid b_j \sim \operatorname{Poisson}(\mu_{ij}), \qquad \log(\mu_{ij})=\log(E_{ij})+\beta_0+\beta_1x_{ij}+b_j, \qquad b_j\sim N(0,\sigma_b^2). $$

Here \(\log(E_{ij})\) is an offset, so the conditional rate per exposure unit is \(\mu_{ij}/E_{ij}\). Assume the random effect is independent of the covariate settings being compared and has the same distribution at both settings. The marginal rate at \(x\) is therefore the conditional rate integrated over \(b_j\):

$$ r(x)=E\left[\frac{\mu_{ij}}{E_{ij}}\mid x\right] =\exp(\beta_0+\beta_1x)E[\exp(b_j)] =\exp\left(\beta_0+\beta_1x+\frac{\sigma_b^2}{2}\right). $$

The final equality follows from the moment-generating function of a normal random variable: if \(b\sim N(0,\sigma^2)\), then \(E[\exp(b)]=\exp(\sigma^2/2)\). For two covariate settings \(x_a\) and \(x_b\), the marginal rate ratio is

$$ \frac{r(x_b)}{r(x_a)} =\frac{\exp(\beta_0+\beta_1x_b+\sigma_b^2/2)} {\exp(\beta_0+\beta_1x_a+\sigma_b^2/2)} =\exp\{\beta_1(x_b-x_a)\}. $$

Thus, in this model, the random-intercept multiplier raises both marginal rates by the same factor and cancels from their ratio. This equality does not mean that the conditional and marginal rates are equal: each marginal rate includes the factor \(\exp(\sigma_b^2/2)\). It means that their ratio is unchanged when the random-intercept distribution is common across settings.

Worked Example: A Random Intercept and a Treatment Rate Ratio

Suppose hypothetical counts follow the model above, with baseline conditional rate \(3\) events per exposure unit, treatment indicator \(x\in\{0,1\}\), conditional treatment rate ratio \(\exp(\beta_1)=1.5\), and random-intercept variance \(\sigma_b^2=0.36\). Calculate both marginal rates and their ratio.

The normal averaging factor is \( \exp(0.36/2)=\exp(0.18)\approx1.197217 \). The marginal control rate is \(3\exp(0.18)\approx3.592\) events per exposure unit. The conditional treatment rate is \(3(1.5)=4.5\), so its marginal rate is \(4.5\exp(0.18)\approx5.388\) events per exposure unit.

The marginal rate ratio is \(5.387478/3.591652=1.500\), equivalently \(1.5\exp(0.18)/\exp(0.18)=1.5\). Under the stated model, the treatment group has 1.5 times the population-averaged rate per exposure unit. This is a model-based rate comparison, not evidence that treatment causes the difference.

Random Slopes: The Averaging Multiplier Can Differ

Now allow the covariate effect to vary across clusters. For a single covariate \(x\), write the random intercept and slope as \(b_{0j}\) and \(b_{1j}\), with \((b_{0j},b_{1j})^\mathsf{T}\sim N(\mathbf{0},\Sigma)\). The conditional mean is

$$ \log(\mu_{ij})=\log(E_{ij})+\beta_0+\beta_1x_{ij}+b_{0j}+b_{1j}x_{ij}. $$

Define \(\mathbf{z}(x)=(1,x)^\mathsf{T}\). The random contribution to the linear predictor is \(\mathbf{z}(x)^\mathsf{T}\mathbf{b}_j\), which is normally distributed with mean zero and variance \(v(x)=\mathbf{z}(x)^\mathsf{T}\Sigma\mathbf{z}(x)\). Integrating its exponential gives

$$ r(x)=\exp(\beta_0+\beta_1x)\exp\left\{\frac{1}{2}\mathbf{z}(x)^\mathsf{T}\Sigma\mathbf{z}(x)\right\}. $$

For \(\Sigma\) with intercept variance \(\sigma_{00}\), slope variance \(\sigma_{11}\), and intercept-slope covariance \(\sigma_{01}\), this variance is \(v(x)=\sigma_{00}+2x\sigma_{01}+x^2\sigma_{11}\). Consequently,

$$ \log\left\{\frac{r(x_b)}{r(x_a)}\right\} =\beta_1(x_b-x_a)+\frac{v(x_b)-v(x_a)}{2}. $$

This equation separates the fixed-effect contrast from the change in the random-effect variance across settings. By contrast, at a particular cluster with random slope \(b_{1j}\), the conditional rate ratio is \(\exp\{(\beta_1+b_{1j})(x_b-x_a)\}\). At zero random effects, the conditional ratio is \(\exp\{\beta_1(x_b-x_a)\}\). The marginal ratio generally differs from that zero-random-effect comparison when \(v(x_b)\ne v(x_a)\). Intercept-slope covariance contributes to that difference as well as slope variance.

Worked Example: A Random Slope Changes the Marginal Ratio

Consider a hypothetical count model with exposure offset, baseline conditional rate \(2\) events per exposure unit, and \(\exp(\beta_1)=1.5\) for the change from \(x=0\) to \(x=1\). Let the random-effect covariance matrix be

$$ \Sigma= \begin{pmatrix} 0.25 & -0.05\\ -0.05 & 0.16 \end{pmatrix}. $$

This is a valid covariance matrix: its diagonal entries are positive and its determinant is \(0.25(0.16)-(-0.05)^2=0.0375>0\). At \(x=0\), \(v(0)=0.25\). At \(x=1\), \(v(1)=0.25+2(-0.05)+0.16=0.31\). The marginal rates are therefore \(r(0)=2\exp(0.25/2)=2\exp(0.125)\approx2.266\) and \(r(1)=3\exp(0.31/2)=3\exp(0.155)\approx3.503\) events per exposure unit.

The marginal rate ratio is \(3.502977/2.266297\approx1.546\). Directly, it is \(1.5\exp\{(0.31-0.25)/2\}=1.5\exp(0.03)\approx1.546\). The zero-random-effect conditional ratio is 1.5, whereas the marginal ratio is about 1.546. The difference arises because the random contribution has greater variance at \(x=1\), and exponentiating a normal quantity produces a larger mean when its variance is larger.

Offsets, Rates, and Expected Counts

A rate ratio and an expected-count ratio answer different questions when exposures differ. With the same random-intercept distribution at both settings, the marginal rate ratio remains \(\exp\{\beta_1(x_b-x_a)\}\). But the expected count is exposure multiplied by the marginal rate. If exposure differs between settings, the expected-count ratio includes the exposure ratio too.

Worked Example: Unequal Exposures Do Not Change the Rate Ratio

Suppose hypothetical groups have conditional baseline rate \(1.2\) events per exposure unit, a treatment rate ratio of \(0.80\), and a shared random-intercept variance of \(0.36\). The control group has exposure \(E_0=2\) units and the treatment group \(E_1=5\) units. Find marginal rates and expected counts.

The marginal multiplier is \(\exp(0.36/2)=\exp(0.18)\approx1.19721736\). Retaining precision through the calculations gives \(r_0=1.2\exp(0.18)\approx1.437\) and \(r_1=1.2(0.80)\exp(0.18)\approx1.149\) events per exposure unit. Their marginal rate ratio is \(r_1/r_0=0.800\).

Expected counts use the actual exposures: \(E(Y_0)=2[1.2\exp(0.18)]\approx2.873\) and \(E(Y_1)=5[1.2(0.80)\exp(0.18)]\approx5.747\) events. The expected-count ratio is approximately \(5.746644/2.873321=2.000\), because the exposure ratio \(5/2=2.5\) multiplies the rate ratio \(0.80\). A larger expected count in the treatment group here does not imply a larger rate.

Assumptions, Diagnostics, and Limits

These integrations require a correctly specified mean model and a random-effects distribution for which the exponential moment exists. In the formulas above, random effects are multivariate normal with mean zero and finite covariance matrix, and their distribution is shared across the covariate settings being compared. The exposure enters as a known offset with coefficient fixed at one. Conditional Poisson sampling is a conventional count-model assumption; the marginal mean formulas follow by integrating the conditional mean over the stated random-effects distribution.

For a random-intercept model, examine whether the common random-intercept distribution is plausible and whether residual variation suggests that the conditional count model is inadequate. For random slopes, also check whether the fitted covariance matrix is admissible, whether the data support estimating slope variation, and whether predicted rates are sensitive to the assumed random-effects distribution. Sparse data or limited within-cluster variation can make a random-slope variance and covariance unstable. Numerical integration or simulation may be useful for models whose random-effects structure is more complicated than the normal random-intercept or slope cases derived here.

A common mistake is to exponentiate the fixed slope and call it the marginal rate ratio in every log-link GLMM. That is correct for a random-intercept model under the shared-distribution assumptions, but not generally for a random-slope model: the marginal log ratio also contains \(\{v(x_b)-v(x_a)\}/2\). Another mistake is to compare expected counts without accounting for exposure. State whether the target is a rate per exposure unit or a count over a specified exposure.

The conditional comparison is useful when the target is a cluster with specified random effects; the marginal comparison is useful when the target is a rate averaged over the model’s random-effects distribution. Neither is automatically preferable: the estimand should match the scientific question. These model-based marginal rates also do not, by themselves, average over differing covariate distributions or establish a causal effect.

Key takeaway: With a normal random intercept and a common random-effects distribution, the log-link averaging multiplier cancels from a rate ratio. With random slopes, the variance of the random linear predictor can differ across covariate settings, so the marginal rate ratio includes a variance-contrast term.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A random-intercept count model has a treatment coefficient \(\beta_1=\log(0.70)\). Under the shared-distribution assumptions, what is the marginal treatment rate ratio?
  2. For a random-slope model, suppose \(v(x_a)=0.20\), \(v(x_b)=0.38\), and the fixed-effect rate ratio from \(x_a\) to \(x_b\) is 1.2. Calculate the marginal rate ratio.
  3. In a random-intercept model, the marginal rate is \(4\) events per exposure unit in group A and the rate ratio for group B versus A is \(0.75\). If exposures are 3 and 8 units, respectively, what are the expected counts and their ratio?
  4. Why can a random-intercept variance change both marginal rates without changing their ratio?

Solutions. (1) The random-intercept multiplier cancels, so the marginal rate ratio is \(\exp(\beta_1)=0.70\). (2) The variance correction is \((0.38-0.20)/2=0.09\), so the marginal ratio is \(1.2\exp(0.09)\approx1.313\). (3) Group A has expected count \(3(4)=12\); group B has rate \(4(0.75)=3\) and expected count \(8(3)=24\). The expected-count ratio is \(24/12=2.00\), while the rate ratio is \(0.75\), because exposure differs. (4) Each marginal rate is multiplied by the same factor \(\exp(\sigma_b^2/2)\); it changes each rate, but cancels when one rate is divided by the other.

Clinical Biostats