Tutorials › Generalized Linear Mixed Models (GLMM) › Why Inverse Links Do Not Commute With Averaging

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

Why Inverse Links Do Not Commute With Averaging

Learn to distinguish integrated response means from plug-in predictions, use Jensen’s inequality when curvature is consistent, and recognize when nonlinear links can still yield equality.

Advanced 10 min read

What You'll Learn

  • Express a GLMM marginal mean as an expectation over the random-effects distribution.
  • Distinguish averaging on the predictor scale from averaging on the response scale.
  • Use Jensen’s inequality to determine the direction of the difference when the inverse link is convex or concave over the predictor’s support.
  • Explain why a nonlinear inverse link can still give equal averages for particular predictor distributions.
  • Diagnose when a plug-in prediction is not an adequate substitute for integration.

Two Different Ways to Average

A GLMM connects a conditional linear predictor to a conditional response mean through an inverse link. When the predictor contains random effects, it varies across the random-effects distribution even at a fixed covariate value. The population-averaged response mean therefore averages the conditional response means. A tempting shortcut is to average the predictors first and then apply the inverse link. These operations are generally different because inverse links are often nonlinear.

The distinction matters whenever a prediction is meant to describe a population that includes variation in its random effects. A prediction for a cluster with random effect set to its mean is a plug-in prediction; it is not automatically the mean response across the random-effects distribution.

Definition: At fixed covariates \(x\), let \(\eta\) be the random conditional linear predictor and let \(h\) be the inverse link. The integrated, or marginal, response mean is \(E[h(\eta)]\). The plug-in response mean based on the average predictor is \(h(E[\eta])\). They generally differ, although they can be equal for particular distributions even when \(h\) is nonlinear.

In a GLMM, for example, \(\eta=x^\mathsf{T}\beta+z^\mathsf{T}b\), where \(b\) denotes random effects. Conditional on \(b\) and \(x\), the response mean is \(h(\eta)\). The law of total expectation gives the marginal mean \(E(Y\mid x)=E_b[h(x^\mathsf{T}\beta+z^\mathsf{T}b)]\). By contrast, applying the inverse link after averaging the predictor gives \(h(E_b[\eta])\). If the random effects have mean zero, \(E_b[\eta]=x^\mathsf{T}\beta\), but that fact does not make the plug-in mean equal to the integrated mean.

Jensen’s Inequality and the Direction of the Difference

Jensen’s inequality gives a useful comparison when the inverse link has consistent curvature across the full support of \(\eta\). If \(h\) is convex on that support and the relevant expectations exist, then \(E[h(\eta)]\geq h(E[\eta])\). If \(h\) is concave there, then \(E[h(\eta)]\leq h(E[\eta])\). The inequality is strict when \(h\) is strictly convex or strictly concave over the relevant range and \(\eta\) is nonconstant, subject to the usual integrability conditions.

One way to justify the convex case is to use the supporting-line property of a differentiable convex function. For any \(m\) in its domain, \(h(u)\geq h(m)+h'(m)(u-m)\). Set \(m=E[\eta]\), substitute \(u=\eta\), and take expectations. The linear term has expectation zero, which yields the result:

$$ E[h(\eta)] \geq E[h(E[\eta])+h'(E[\eta])(\eta-E[\eta])] =h(E[\eta]). $$

Reversing the supporting-line inequality proves the concave case. If curvature changes sign over the support, this argument supplies no general direction. Moreover, nonlinearity alone does not guarantee a difference: the positive and negative contributions can balance for a particular distribution.

Worked Example: A Convex Inverse Link Gives an Upward Difference

Suppose a hypothetical model has inverse link \(h(\eta)=\exp(\eta)\), and at a fixed covariate value the random predictor takes \(-0.5\) and \(0.5\), each with probability \(0.5\). The exponential function is convex everywhere, so Jensen’s inequality predicts that the integrated mean is at least the plug-in mean.

The average predictor is \(E[\eta]=0.5(-0.5)+0.5(0.5)=0\). Thus the plug-in mean is \(\exp(0)=1\).

The integrated mean is \(E[\exp(\eta)]=0.5\exp(-0.5)+0.5\exp(0.5)=0.5(0.6065)+0.5(1.6487)=1.1276\). It exceeds the plug-in mean by \(1.1276-1=0.1276\). The direction agrees with convexity over the entire predictor range.

Curvature Can Change, and Differences Can Cancel

For the logistic inverse link \(h(\eta)=1/(1+\exp(-\eta))\), the second derivative is \(h''(\eta)=h(\eta)(1-h(\eta))(1-2h(\eta))\). It is positive for \(\eta<0\), zero at \(\eta=0\), and negative for \(\eta>0\). Thus the link is convex on the negative half-line and concave on the positive half-line. If the predictor distribution spans both regions, Jensen’s inequality alone does not determine the direction of the difference.

Worked Example: A Nonlinear Link Can Give Equality

Consider a hypothetical predictor that equals \(-1\) or \(1\), each with probability \(0.5\), and use the logistic inverse link. The predictor is nonconstant, and the inverse link is nonlinear. Its mean is \(E[\eta]=0.5(-1)+0.5(1)=0\), so the plug-in mean is \(h(0)=0.5\).

The integrated mean is \(0.5h(-1)+0.5h(1)=0.5(0.2689)+0.5(0.7311)=0.5000\). It equals the plug-in mean. The logistic link has opposite curvature on the two sides of zero, and in this symmetric example the contributions balance exactly. Therefore, it would be incorrect to claim that a nonconstant predictor and a nonlinear inverse link must produce unequal averages.

Worked Example: Mean Zero Does Not Determine the Direction

Compare two hypothetical predictor distributions under the logistic inverse link. Both have mean zero, but their integrated means fall on opposite sides of \(h(0)=0.5\).

First, let \(\eta=-1\) with probability \(2/3\) and \(\eta=2\) with probability \(1/3\). Its mean is \((2/3)(-1)+(1/3)(2)=0\), so its plug-in mean is \(0.5\). Its integrated mean is \((2/3)(0.2689)+(1/3)(0.8808)=0.4729\), which is below \(0.5\).

Now let \(\eta=-2\) with probability \(1/3\) and \(\eta=1\) with probability \(2/3\). Its mean is \((1/3)(-2)+(2/3)(1)=0\), again giving plug-in mean \(0.5\). Its integrated mean is \((1/3)(0.1192)+(2/3)(0.7311)=0.5271\), which is above \(0.5\).

A nonconstant predictor with mean zero must have positive probability on both sides of zero: if it were entirely nonnegative or entirely nonpositive, its mean could be zero only if it were zero with probability one. Here, spanning both sides means the logistic link’s curvature is not consistent over the support. The distribution’s details—not its mean alone—determine the difference.

Interpreting and Computing the Relevant Mean

The target determines which calculation is appropriate. For a population-averaged response mean at fixed \(x\), integrate \(h(\eta)\) over the random-effects distribution. For a prediction at a specified random-effects value, evaluate \(h(\eta)\) at that value. For a plug-in prediction at the mean predictor, use \(h(E[\eta])\), while being explicit that this is not generally the integrated response mean.

When the integral is not available in closed form, it can be approximated by numerical integration or simulation. With simulated random effects \(b_1,\ldots,b_M\) drawn from the assumed random-effects distribution, an estimate of the integrated mean is \(M^{-1}\sum_{m=1}^M h(x^\mathsf{T}\beta+z^\mathsf{T}b_m)\). This averages after applying the inverse link to each simulated predictor. Averaging the simulated predictors first and applying \(h\) once instead estimates the plug-in quantity.

This comparison presumes a well-defined random-effects distribution, finite expectations for the quantities being averaged, and a correctly specified conditional mean and inverse link. If these assumptions are doubtful, a precise numerical integral does not repair the model. The integral is also tied to the target population represented by the random-effects distribution; changing that distribution can change the marginal mean.

Diagnostics, Alternatives, and Limitations

A practical check is to inspect the range of predictors that receives appreciable probability under the random-effects distribution and the curvature of \(h\) over that range. If curvature has one sign throughout, Jensen’s inequality provides a direction check. If curvature changes sign, compare the integrated mean and plug-in mean directly rather than guessing the direction from the mean predictor or from the link’s overall nonlinearity.

For a numerical calculation, check that the random-effects draws or integration points represent the intended distribution, that averaging is done on the response scale after applying \(h\), and that the estimate is stable as the number of draws or integration accuracy increases. A large discrepancy between two approaches is not necessarily a computational error: it may be the consequence of curvature and random-effects variability. Conversely, agreement in one example does not establish that the operations commute generally.

The main alternatives answer different questions. Integrated predictions target the average conditional response over random effects. Plug-in predictions target the response at an averaged predictor. An identity inverse link is an important special case: when \(h(u)=u\) and expectations exist, \(E[h(\eta)]=h(E[\eta])\) exactly. For nonlinear links, equality may still occur for a particular distribution, but it should be checked rather than assumed. Jensen’s inequality gives a bound only when its convexity or concavity condition holds across the support; it does not provide a universal approximation or direction when curvature changes.

Common pitfall: “The random effects have mean zero, so applying the inverse link to the fixed-effects predictor gives the population mean.” Mean-zero random effects imply that the average predictor is the fixed-effects predictor; they do not imply that the average inverse-link response equals the inverse link of that predictor. Compute or approximate the response-scale integral when the population-averaged mean is the target.

Check Your Understanding

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

  1. If \(h\) is strictly concave over the full support of a nonconstant \(\eta\), which is larger: \(E[h(\eta)]\) or \(h(E[\eta])\)?
  2. Does nonlinearity alone prove that \(E[h(\eta)]\ne h(E[\eta])\)?
  3. A nonconstant predictor has mean zero and is used with the logistic inverse link. Can its support lie entirely on one side of zero? Does Jensen’s inequality give a general direction?
  4. What should be averaged first to estimate an integrated GLMM mean by simulation: the predictors or the conditional response means?

Solutions. 1. Strict concavity gives \(E[h(\eta)]<h(E[\eta])\) when the expectations exist and \(\eta\) is nonconstant. 2. No. A particular distribution can yield equality, as the equal-probability logistic example at \(-1\) and \(1\) shows. 3. No: a nonconstant mean-zero variable must put positive probability on both sides of zero. Logistic curvature changes sign there, so Jensen’s inequality supplies no general direction; the distribution’s details matter. 4. Apply the inverse link to each simulated predictor and then average those conditional response means. Averaging predictors first instead gives the plug-in mean.

Clinical Biostats