Tutorials › Generalized Linear Mixed Models (GLMM) › Log-Link Count Models And Marginal Rate Ratios

GLMM Versus GEE · Tutorial 122 of 698

Log-Link Count Models And Marginal Rate Ratios

Learn why a common random intercept cancels from a marginal rate ratio, and when random-effect differences prevent that cancellation.

Intermediate 10 min read

What You'll Learn

  • Define conditional and marginal rate ratios for log-link count models with exposure offsets.
  • Derive the marginal mean under a normally distributed random intercept.
  • Identify the assumptions that make conditional and marginal rate ratios equal.
  • Calculate marginal rates and rate ratios from hypothetical model parameters.
  • Recognize how differing random-effect distributions or random slopes alter the comparison.
  • Check model features that can make the averaging result inappropriate.

Why Averaging Matters for Count Rates

A log-link count model expresses effects multiplicatively: a coefficient for a binary predictor becomes a rate ratio after exponentiation. In a generalized linear mixed model, that rate ratio is usually conditional on the cluster’s random effect. The corresponding marginal rate ratio compares rates after averaging over the random-effect distribution. These two comparisons need not agree in every model.

For a random-intercept log-link model, however, a useful special result holds. When the same random-intercept distribution applies in both exposure groups, the random intercept multiplies both marginal rates by the same factor. It therefore cancels from their ratio. This differs from the familiar change in odds ratios that can occur when averaging a logistic mixed model: the log link has a multiplicative mean structure that allows this cancellation under suitable conditions.

Model and Assumptions

Definition: Let \(Y_{ij}\) be a count for observation \(i\) in cluster \(j\), \(A_{ij}\) a binary exposure, and \(t_{ij}>0\) the observation’s exposure time. A Poisson random-intercept log-link model is $$ Y_{ij}\mid b_j \sim \operatorname{Poisson}(\mu_{ij}), \qquad \log(\mu_{ij})=\log(t_{ij})+\beta_0+\beta_A A_{ij}+b_j, $$ where \(b_j\) is a cluster-specific random intercept. The conditional rate is \(\mu_{ij}/t_{ij}\), and the conditional rate ratio for \(A_{ij}=1\) versus \(A_{ij}=0\), at the same \(b_j\), is \(\exp(\beta_A)\).

For the standard calculation below, assume \(b_j\sim N(0,\tau^2)\), with the same distribution in both exposure groups and independent of \((A_{ij},t_{ij})\). The comparison also holds at the same values of any other covariates included in the model. Exposure time is represented by an offset, whose coefficient is fixed at one. The Poisson assumption specifies the conditional count distribution; the equality of rate ratios after averaging follows from the conditional mean and random-intercept assumptions, not from the Poisson variance specifically.

The marginal mean is obtained by averaging the conditional mean over the random-intercept distribution. This is different from setting \(b_j=0\): the value at \(b_j=0\) describes a cluster at the center of the random-effect distribution, while the marginal mean averages across clusters.

Theorem: Under the stated model and assumptions, the marginal rate at exposure value \(a\), conditional on exposure time \(t_{ij}\), is $$ \frac{E(Y_{ij}\mid A_{ij}=a,t_{ij})}{t_{ij}} =\exp(\beta_0+\beta_A a)\exp(\tau^2/2). $$ Consequently, the marginal rate ratio comparing \(a=1\) with \(a=0\) is \(\exp(\beta_A)\), equal to the conditional rate ratio.

Why the Rate Ratio Is Preserved

The conditional mean can be written as \(t_{ij}\exp(\beta_0+\beta_A a+b_j)\). Averaging over \(b_j\) factors the fixed-effect portion out of the expectation. For a normal random variable with mean zero and variance \(\tau^2\), the moment-generating function gives \(E[\exp(b_j)]=\exp(\tau^2/2)\). Thus the marginal rate contains a multiplicative factor that does not depend on exposure value.

$$ \begin{aligned} E(Y_{ij}\mid A_{ij}=a,t_{ij}) &=t_{ij}\exp(\beta_0+\beta_Aa)E\{\exp(b_j)\}\\ &=t_{ij}\exp(\beta_0+\beta_Aa)\exp(\tau^2/2),\\ \frac{E(Y_{ij}\mid A_{ij}=1,t_{ij})/t_{ij}} {E(Y_{ij}\mid A_{ij}=0,t_{ij})/t_{ij}} &=\frac{\exp(\beta_0+\beta_A)\exp(\tau^2/2)} {\exp(\beta_0)\exp(\tau^2/2)} =\exp(\beta_A). \end{aligned} $$

The normality assumption supplies the explicit multiplier \(\exp(\tau^2/2)\). The cancellation itself is more general: if the random intercept has the same distribution in both exposure groups and \(E\{\exp(b_j)\}\) is finite, that common expectation cancels, even if the distribution is not normal. If the random-effect distributions differ by exposure, or the treatment effect varies randomly across clusters, the multiplier need not be common and the marginal rate ratio can change.

Worked Example: A Common Random Intercept

Suppose a hypothetical study models event counts per person-year with a random-intercept Poisson model. The baseline conditional rate at \(b_j=0\) is \(2.0\) events per person-year, the conditional exposure rate ratio is \(1.40\), and the random-intercept variance is \(\tau^2=0.25\). Assume the same normal random-intercept distribution in both exposure groups.

The marginal multiplier is \(E\{\exp(b_j)\}=\exp(0.25/2)=\exp(0.125)=1.133148\). The marginal rate for the unexposed group is therefore \(2.0\exp(0.125)\approx2.266297\), or \(2.266\) events per person-year.

The conditional exposed rate at \(b_j=0\) is \(2.0(1.40)=2.8\) events per person-year. Averaging over the random intercept gives the exposed marginal rate \(2.8\exp(0.125)\approx3.172816\), or approximately 3.173 events per person-year.

The marginal rate ratio is \(\{2.8\exp(0.125)\}/\{2.0\exp(0.125)\}=1.40\). The equality is not a claim that every cluster has the same rate: the random intercept allows rates to vary across clusters. It follows because the same averaging multiplier applies to both exposure groups.

When Averaging Does Not Preserve the Rate Ratio

The cancellation requires the random-intercept distribution to be the same across the groups being compared. If the distribution differs, the marginal rate ratio includes the ratio of the groups’ mean values of \(\exp(b_j)\). This can happen, for example, when exposure groups differ in their cluster composition. The conditional coefficient still describes the model’s contrast at a fixed random effect, but it does not by itself determine the comparison between those different group mixtures.

Worked Example: Different Random-Intercept Variances

Consider a hypothetical model with conditional rate \(1.5\exp(0.4A+b)\) events per person-year. Suppose the random intercept is normal with mean zero, but its variance is \(0.16\) in the unexposed group and \(0.64\) in the exposed group.

At a fixed value of \(b\), the conditional rate ratio is \(\exp(0.4)=1.4918\). The group-specific marginal rates, however, use different averaging factors:

$$ \begin{aligned} \text{Unexposed marginal rate} &=1.5\exp(0.16/2) =1.5\exp(0.08) \approx 1.625,\\ \text{Exposed marginal rate} &=1.5\exp(0.4)\exp(0.64/2) =1.5\exp(0.72) \approx 3.082. \end{aligned} $$

The marginal rate ratio is \(3.082/1.625\approx\exp(0.4+0.32-0.08)=\exp(0.64)\approx1.896\). It differs from the conditional ratio \(1.4918\). The added \(0.32-0.08\) is the difference between the log averaging factors, \(\tau^2/2\), in the two groups. Thus the equal-rate-ratio result does not apply when the random-effect distributions differ.

A second failure occurs when the exposure effect itself varies across clusters. A random slope creates a cluster-specific exposure coefficient, so averaging its exponent changes the marginal ratio. For jointly normal random effects, this change can be calculated directly.

Worked Example: A Random Exposure Slope

Suppose a hypothetical count-rate model is \(\lambda(A\mid b_0,b_1)=2.0\exp(0.30A+b_0+b_1A)\) events per person-year. Let \(b_0\) and \(b_1\) have joint normal distribution with mean zero, \(\operatorname{Var}(b_0)=0.36\), \(\operatorname{Var}(b_1)=0.25\), and \(\operatorname{Cov}(b_0,b_1)=-0.05\). The covariance matrix is valid: its determinant is \(0.36(0.25)-(-0.05)^2=0.0875>0\).

For the unexposed group, the random part is \(b_0\), so its marginal rate is \(2.0\exp\{0.36/2\}=2.0\exp(0.18)\approx2.394\) events per person-year. For the exposed group, the random part is \(b_0+b_1\). Its variance is \(0.36+0.25+2(-0.05)=0.51\), giving marginal rate \(2.0\exp(0.30+0.51/2)=2.0\exp(0.555)\approx3.484\) events per person-year.

The marginal rate ratio is \(\exp(0.555-0.18)=\exp(0.375)\approx1.455\), rather than the fixed-effect ratio \(\exp(0.30)\approx1.350\). In general, under these joint-normal assumptions, the marginal ratio is \(\exp\{\beta_A+\operatorname{Var}(b_1)/2+\operatorname{Cov}(b_0,b_1)\}\). A random slope therefore prevents the simple random-intercept cancellation.

Interpretation, Diagnostics, and Alternatives

The equality of conditional and marginal rate ratios is a property of a particular mean structure and averaging distribution; it is not a universal property of count GLMMs. It matters because the conditional coefficient and the marginal comparison answer different questions. A conditional rate ratio compares observations at the same random intercept. A marginal rate ratio compares average rates over the specified random-effect distribution. Under the shared random-intercept assumptions, their numerical equality does not make those interpretations identical.

Before using the result, verify that the model has a log link, an offset with coefficient one when rates are intended, and a common random-intercept distribution across exposure groups. Check whether the model includes random slopes or exposure-by-covariate interactions. For an interaction, the rate ratio may vary with the covariate, so comparisons must be made at specified covariate values. Also check that the model’s fitted mean is adequate for the count data; a poor mean model cannot be repaired by the cancellation argument.

Useful checks include examining observed and fitted rates by exposure and cluster, looking for systematic residual patterns, and assessing whether a small number of clusters dominate the fitted random-effect distribution. Substantial overdispersion, many zeros beyond model expectations, or unstable random-effect estimates may indicate that the chosen count distribution or random-effects structure is inadequate. These issues do not automatically invalidate the algebra, but they can make the assumed model a poor description of the data. In particular, a random-effects distribution estimated from few clusters may give an unreliable marginal multiplier.

ApproachEffect comparisonKey point
Log-link GLMM with a common random interceptConditional rate ratio; under the stated conditions it equals the marginal rate ratioModels cluster heterogeneity through random effects
GEE with a log linkPopulation-averaged rate ratio in its specified mean modelDirectly targets a marginal mean comparison rather than deriving it by integrating a random-effects model
Log-link model without cluster effectsRate ratio under its own mean and dependence assumptionsIgnoring clustering can misrepresent dependence and uncertainty

The GLMM result should not be used to claim that a GLMM and GEE are interchangeable in all respects. They may use different assumptions, estimate uncertainty differently, or target different comparisons when the random-effect distribution varies by exposure or when random slopes are present. The equality here is narrow: a log-linear conditional mean with a shared multiplicative random intercept preserves the rate ratio after averaging.

Common Pitfall

Wrong reasoning: “The model has a random intercept, so the marginal rate ratio must always equal \(\exp(\beta_A)\).” This skips the conditions that make the random-effect multiplier common.

Correction: First identify what is being averaged and whether the same distribution applies in both groups. With a shared random intercept, the factor \(E\{\exp(b_j)\}\) cancels. With group-specific random-effect distributions, or a random exposure slope, the numerator and denominator generally contain different expectations, and the marginal ratio must be calculated from them.

Key takeaway: In a log-link count model, a common random intercept multiplies both marginal rates by the same positive factor, so the conditional and marginal rate ratios agree. Equality depends on a shared random-intercept distribution and a nonrandom exposure effect; it is not guaranteed by the log link alone.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. A log-link model has \(\beta_A=\log(1.25)\) and a common random intercept independent of exposure. What are the conditional and marginal rate ratios?
  2. If \(b\sim N(0,0.18)\), what factor relates a conditional rate at \(b=0\) to the marginal rate under a shared random-intercept model?
  3. Why can differing random-intercept variances by exposure group change the marginal rate ratio?
  4. In the random-slope example, calculate the marginal rate ratio using the fixed coefficient and the slope variance and covariance.

Solutions. (1) Both ratios are \(\exp\{\log(1.25)\}=1.25\), provided the shared-distribution assumptions hold. (2) The factor is \(\exp(0.18/2)=\exp(0.09)\approx1.094\). (3) The factors \(E\{\exp(b)\}\) differ by group, so they do not cancel in the ratio. (4) The marginal ratio is \(\exp\{0.30+0.25/2-0.05\}=\exp(0.375)\approx1.455\).

Clinical Biostats