Tutorials › Generalized Linear Mixed Models (GLMM) › Identity Links And Equality Of Effects

GLMM Versus GEE · Tutorial 121 of 698

Identity Links And Equality Of Effects

Learn why a mean-zero random intercept preserves a linear effect under averaging, which assumptions make that result valid, and how to recognize when it does not apply.

Intermediate 12 min read

What You'll Learn

  • Derive the marginal mean from an identity-link random-intercept model.
  • Distinguish a mean-zero random intercept from one with mean zero conditional on the predictors.
  • Verify equality of conditional and marginal slopes with explicit calculations.
  • Identify how predictor-dependent cluster effects can change the marginal slope.
  • Compare the equality result with nonlinear-link models and population-averaged estimation.
  • Recognize mean-model and probability-range problems that can invalidate an identity-link specification.

Why Averaging Can Preserve a Linear Effect

A conditional GLMM describes the mean response for a cluster after accounting for that cluster’s random effect. A marginal mean instead averages over the random effects in the target population. These are different targets in general. With an identity link and an additive random intercept, however, averaging can leave the fixed-effect slope unchanged. The reason is direct: averaging a mean-zero additive term removes it without transforming the predictor effect.

This equality is useful, but it is not automatic merely because a model contains a random intercept. The random intercept must have conditional mean zero across the predictor values being compared, and the conditional mean must have the stated linear form. The result concerns the mean and its slope; it does not imply that conditional and marginal variances, predictions for particular clusters, or all aspects of the models are identical.

Definition: For cluster \(i\) and observation \(j\), an identity-link random-intercept mean model is $$ E(Y_{ij}\mid X_{ij},b_i)=\beta_0+\beta_1X_{ij}+b_i, $$ where \(Y_{ij}\) is the response, \(X_{ij}\) is a scalar predictor, \(\beta_0\) and \(\beta_1\) are fixed coefficients, and \(b_i\) is the cluster-specific random intercept. The identity link means that the conditional mean equals the linear predictor itself. The marginal mean is \(E(Y_{ij}\mid X_{ij})\), obtained by averaging over the random-effect distribution conditional on the predictor.

For the equality result, assume the random intercept is mean-zero at every predictor value: \(E(b_i\mid X_{ij}=x)=0\) for all relevant \(x\). Independence between the random effects and predictors is a common, stronger condition that ensures this. Also assume the conditional mean is correctly specified, the predictor effect is linear and additive, and there is no predictor-by-random-effect interaction. Under these conditions, the conditional slope is \(\beta_1\) for every fixed \(b_i\), and the marginal slope is also \(\beta_1\).

The Averaging Argument

The central calculation uses the law of iterated expectation: average the conditional mean over the random intercepts that occur at a given predictor value. The condition on the conditional mean of \(b_i\) is essential; an unconditional mean of zero alone need not suffice.

$$ \begin{aligned} E(Y_{ij}\mid X_{ij}=x) &=E\{E(Y_{ij}\mid X_{ij}=x,b_i)\mid X_{ij}=x\}\\ &=E(\beta_0+\beta_1x+b_i\mid X_{ij}=x)\\ &=\beta_0+\beta_1x+E(b_i\mid X_{ij}=x)\\ &=\beta_0+\beta_1x. \end{aligned} $$

The marginal mean is therefore a straight line with intercept \(\beta_0\) and slope \(\beta_1\). For two predictor values \(x_1\) and \(x_2\), the marginal mean difference is \(E(Y\mid X=x_2)-E(Y\mid X=x_1)=\beta_1(x_2-x_1)\). Dividing by \(x_2-x_1\), when the values differ, gives the marginal slope \(\beta_1\). At a fixed cluster effect \(b_i\), the conditional mean difference is also \(\beta_1(x_2-x_1)\), because the same intercept \(b_i\) appears at both predictor values.

The calculation does not require a normally distributed random intercept. For the mean equality, the required fact is the conditional mean-zero property and existence of the expectations. A normal random-effect distribution is often used in GLMM specifications, but its normality is not what makes the slopes equal.

Worked Example: Averaging Three Cluster Intercepts

Suppose a hypothetical continuous-response model has conditional mean \(E(Y_{ij}\mid X_{ij}=x,b_i)=50+6x+b_i\). In the target population, the random intercept takes values \(-4\), \(0\), and \(4\), with probabilities \(0.25\), \(0.50\), and \(0.25\), independently of \(X\). Verify the equality of slopes for \(x=0\) and \(x=1\).

First check the required mean condition: \(E(b_i)=0.25(-4)+0.50(0)+0.25(4)=-1+0+1=0\). Independence ensures the same mean at each value of \(x\).

At \(x=0\), the conditional means for the three intercept values are \(50-4=46\), \(50+0=50\), and \(50+4=54\). Their weighted average is \(0.25(46)+0.50(50)+0.25(54)=11.5+25+13.5=50\).

At \(x=1\), the conditional means are \(50+6-4=52\), \(50+6=56\), and \(50+6+4=60\). Their weighted average is \(0.25(52)+0.50(56)+0.25(60)=13+28+15=56\). The marginal mean increases by \(56-50=6\) response units when \(x\) increases by one unit. This equals the conditional slope, \(6\) response units per predictor unit.

What the Equality Does and Does Not Say

Equality of the slopes is a statement about a particular mean contrast under the model. It does not say that each cluster’s response changes by the same amount in every realized sample, nor that predictions for a particular cluster are the same as population-average predictions. For a known cluster effect \(b_i\), the conditional mean includes \(b_i\); the marginal mean does not. The equality concerns how each mean changes with \(x\).

It also does not imply equal variability. For example, if the conditional residual variance is \(\sigma^2\) and is constant, and \(b_i\) is independent of \(X\) with variance \(\tau^2\), then the marginal variance is \(\sigma^2+\tau^2\). Averaging removes the mean-zero term from the mean, but the random intercept still contributes variation among clusters. More generally, the marginal variance is the average conditional variance plus the variance of the conditional mean across random effects.

Worked Example: Checking the Slope Across a Wider Predictor Range

Consider the hypothetical model \(E(Y_{ij}\mid X_{ij}=x,b_i)=10+2.5x+b_i\), with \(E(b_i\mid X_{ij}=x)=0\) for all relevant \(x\). Compare the marginal means at \(x=2\), \(x=5\), and \(x=8\).

At \(x=2\), the marginal mean is \(10+2.5(2)+0=15\) response units. At \(x=5\), it is \(10+2.5(5)+0=22.5\) response units. At \(x=8\), it is \(10+2.5(8)+0=30\) response units.

From \(x=2\) to \(x=5\), the slope calculated from the marginal means is \((22.5-15)/(5-2)=7.5/3=2.5\) response units per predictor unit. From \(x=5\) to \(x=8\), it is \((30-22.5)/(8-5)=7.5/3=2.5\) response units per predictor unit. The result holds across the range because the marginal mean is linear, not just because one particular pair of predictions happens to have a difference of 2.5.

Why Conditional Mean Zero Matters

Suppose instead that the average random intercept varies with the predictor. Averaging then gives \(E(Y\mid X=x)=\beta_0+\beta_1x+E(b_i\mid X=x)\). The last term is now part of the marginal mean and can alter its slope. Even a random effect with unconditional mean zero can have nonzero conditional means at particular predictor values.

Worked Example: An Unconditional Mean of Zero Is Not Enough

In a hypothetical population, let \(X\) be binary and equally likely to be 0 or 1. Suppose the conditional model is \(E(Y\mid X=x,b)=20+5x+b\). For clusters with \(X=0\), let \(b=-2\) on average; for clusters with \(X=1\), let \(b=2\) on average. These conditional averages could, for example, be fixed values within the two groups.

The unconditional mean of \(b\) is \(0.50(-2)+0.50(2)=0\). But the conditional means are not zero at each predictor value. At \(X=0\), the marginal mean is \(20+5(0)-2=18\). At \(X=1\), it is \(20+5(1)+2=27\).

The marginal mean difference is \(27-18=9\) response units for a one-unit increase in \(X\), whereas the conditional slope is \(5\) response units. Thus \(E(b)=0\) does not establish equal slopes. Here the group-specific average intercept contributes an additional difference of \(2-(-2)=4\) response units.

In applications, a dependence between cluster characteristics and predictors may arise because the predictor values occur disproportionately in clusters with different baseline response levels. A random-intercept model that assumes independence can then fail to represent the predictor-related structure of the data. This is not repaired by noting that the random-effect distribution is centered at zero overall.

Assumptions, Diagnostics, and Alternatives

Before interpreting \(\beta_1\) as both a conditional and a marginal slope, check the structure that supports the averaging calculation:

  • Identity scale and additive form: the conditional mean must be \(\beta_0+\beta_1x+b_i\), rather than a transformed linear predictor or another nonlinear function of it.
  • Conditional mean-zero random intercept: \(E(b_i\mid X=x)=0\) over the predictor values and target population of interest. Independence of random effects and predictors is sufficient, but stronger than the algebra itself requires.
  • No varying slope in the specified model: the effect of \(x\) must not vary with \(b_i\). In a model containing a random slope, averaging its contribution requires its conditional mean, given the predictors, to be zero as well.
  • Adequate mean specification: omitted curvature, interactions, or predictor-related cluster structure can make the fitted linear slope a poor summary even when the algebra for the stated model is correct.
  • A valid response model: the conditional response distribution must support the stated conditional mean for the relevant predictors and random effects.

Diagnostics should therefore examine more than whether estimated random intercepts appear centered overall. Check whether residual patterns suggest curvature or a changing predictor effect, and whether cluster-level response patterns are related to predictor composition. Compare observed and fitted means over relevant predictor values. Estimated cluster effects can be useful for identifying unusual clusters, but their shrinkage and estimation uncertainty mean that they should not be treated as direct proof of the conditional mean-zero assumption.

For continuous responses, an identity-link mean is often natural because differences in the response scale are directly meaningful. For a binary response, an identity-link mean represents a probability, so fitted conditional probabilities must remain between 0 and 1 for the covariate values and random effects allowed by the model. A normal random-intercept distribution has unbounded support; consequently, it can assign positive probability to intercept values that produce invalid probabilities. The linear averaging identity alone does not ensure that such a binary-response model is a valid probability model.

The key contrast with a nonlinear link is that, in general, averaging a transformed linear predictor does not leave the same linear form on the response-mean scale. This is why the equality result is specific to an additive identity-link mean and should not be carried over from it to logistic models. The earlier material on logistic random-intercept averaging establishes the relevant contrast: nonlinear transformation and averaging need not preserve the fixed-effect coefficient as a marginal effect.

ApproachMean targetRelation to this result
Identity-link random-intercept GLMMConditional mean given the cluster effectUnder the stated conditions, its fixed slope is also the marginal mean slope.
Population-averaged model such as GEEMarginal mean directlyTargets the population-average mean without needing this conditional-to-marginal equality argument.
Nonlinear-link GLMMConditional mean given the cluster effectAveraging generally changes the response-scale relationship; the identity-link result does not apply.

The approaches are not interchangeable in every respect. A GEE and a GLMM may target different aspects of clustered data and use different assumptions and variance methods. Even when the slope equality holds for the mean, the GLMM still specifies a random-effect distribution and within-cluster structure, while the equality itself says nothing about whether that distribution or dependence structure is correctly specified. The equality is a mean-model result, not a universal equivalence between GLMM and GEE analyses.

Common Mistakes and Limitations

  • Wrong reasoning: “The random intercept has mean zero overall, so averaging always preserves the slope.” Correction: the needed condition is \(E(b_i\mid X=x)=0\) at each predictor value. The preceding example has \(E(b_i)=0\) but different conditional means, so its slopes differ.
  • Wrong reasoning: “Equal slopes mean the conditional and marginal predictions are identical.” Correction: conditional predictions include the particular cluster’s \(b_i\); marginal predictions average over the random effects. Their mean levels can differ even when their slopes match.
  • Wrong reasoning: “The result applies to any GLMM with a random intercept.” Correction: it relies on an additive identity-link mean. A nonlinear link changes how averaging operates on the response scale.
  • Wrong reasoning: “A fitted identity-link probability model is valid because the marginal probabilities are in range.” Correction: a binary-response model must also produce valid conditional probabilities for the random effects and covariate values it allows.
Key takeaway: For an additive identity-link random-intercept model, the conditional and marginal slopes are equal when the random intercept has conditional mean zero at every relevant predictor value. The equality is about the mean slope only; it does not establish equal predictions, equal variances, or validity of the other model assumptions.

Check Your Understanding

Answer each question using the model assumptions, not just the phrase “mean-zero random effect.” Short solutions follow the questions.

  1. For \(E(Y\mid X=x,b)=12+3x+b\), with \(E(b\mid X=x)=0\), what is the marginal mean and its slope?
  2. If \(E(b)=0\), but \(E(b\mid X=0)=-1\) and \(E(b\mid X=1)=1\), does unconditional mean zero guarantee equal conditional and marginal slopes? Explain.
  3. Does the equality of slopes imply that the marginal variance equals the conditional residual variance? Why or why not?
  4. Why is a mean-zero normal random intercept alone not enough to guarantee a valid identity-link probability model for a binary response?
  5. Name one condition under which averaging a random intercept preserves the fixed-effect slope, and one model feature that can invalidate this conclusion.

Solutions. (1) Iterated expectation gives \(E(Y\mid X=x)=12+3x+E(b\mid X=x)=12+3x\); the marginal slope is 3 response units per predictor unit. (2) No. The conditional random-effect means differ by 2, so that term contributes 2 units to the marginal difference between \(X=0\) and \(X=1\). (3) No. The random intercept contributes between-cluster variance to the marginal variance; with independent effects and constant conditional variance, the marginal variance is the conditional variance plus \(\operatorname{Var}(b)\). (4) A normal random intercept is unbounded, so some values can make the identity-link conditional mean fall below 0 or exceed 1, which is invalid as a probability. (5) A sufficient condition is \(E(b\mid X=x)=0\) for every relevant \(x\). A nonlinear link, predictor-dependent random-intercept mean, or predictor-by-random-effect interaction can invalidate the stated equality result.

Clinical Biostats