Why Standardize Marginal Predictions?
A GLMM prediction at a particular covariate profile answers a profile-specific question: what response is predicted for a unit with those covariate values, after accounting for the random-effects distribution? Often the scientific question instead concerns a population containing a range of covariate profiles. In that case, a single profile may not represent the population of interest.
Standardization makes the population explicit. First, calculate the model-predicted response for each covariate profile after integrating over the random effects. Then average those predictions according to a stated target distribution of covariates. This produces an estimand tied to a population, not to an arbitrarily selected “typical” profile.
The order matters. The model supplies a conditional mean given covariates and random effects. Integration over \(B\) gives the marginal response-scale prediction for each covariate profile. Averaging those predictions over \(Q\) then gives the target-population quantity. In general, this is not the same as setting \(X\) equal to its mean, and it is not the same as averaging linear predictors before applying a nonlinear link inverse.
Finite Target Populations and the Calculation
For a target population described by a finite set of profiles \(x_1,\ldots,x_K\) with prespecified weights \(q_1,\ldots,q_K\), where \(q_k\geq0\) and \(\sum_{k=1}^{K}q_k=1\), standardization is a weighted average:
The weights describe the target population’s covariate distribution. They are not automatically the proportions in the model-fitting sample. Nor are they random-effects weights: random-effects integration is already included in each \(m(a,x_k)\). A standardized contrast is calculated from the standardized predictions, using the scale that matches the question: a difference in response units, a risk difference, a rate ratio, or another explicitly defined contrast.
Worked Example: Standardizing Poisson Rates to a Stated Population
Suppose a hypothetical Poisson-lognormal GLMM models a count \(Y\) over exposure \(E\), with \(A\) binary, \(X\) binary, and random intercept \(B\sim N(0,0.25)\): $$ \log\{E(Y\mid A,X,B,E)/E\} =\log(2)+\log(1.5)A+\log(2)X+\log(0.8)AX+B. $$ The exposure is held at one unit when reporting rates. The target population has \(X=0\) with weight 0.70 and \(X=1\) with weight 0.30. Find the standardized rates for \(A=0\) and \(A=1\), and their difference.
For a fixed \(A,X\), the conditional rate is the fixed-effects rate multiplied by \(\exp(B)\). Since \(B\sim N(0,0.25)\), the normal moment-generating function gives \(E\{\exp(B)\}=\exp(0.25/2)=\exp(0.125)\). Thus the profile-specific marginal rate is the fixed-effects rate multiplied by \(\exp(0.125)\approx1.133148\).
For \(A=0,X=0\), the integrated rate is \(2\exp(0.125)=2.2663\) expected counts per unit exposure. For \(A=0,X=1\), it is \(4\exp(0.125)=4.5326\). Standardizing gives $$ \Psi_Q(0)=0.70[2\exp(0.125)]+0.30[4\exp(0.125)] =2.9462 $$ expected counts per unit exposure.
For \(A=1,X=0\), the fixed-effects rate is \(2(1.5)=3\), so its integrated rate is \(3\exp(0.125)=3.399444\ldots\), or 3.3994 to four decimal places. For \(A=1,X=1\), the fixed-effects rate is \(2(1.5)(2)(0.8)=4.8\), giving \(4.8\exp(0.125)=5.4391\). Therefore, $$ \Psi_Q(1)=0.70[3\exp(0.125)]+0.30[4.8\exp(0.125)] =4.011344\ldots\approx4.0113. $$
The standardized rate difference is \(4.011344\ldots-2.946186\ldots=1.065158\ldots\), approximately 1.065 expected counts per unit exposure. The standardized rate ratio is \(4.011344\ldots/2.946186\ldots\approx1.362\). Both summaries use the same target distribution; neither is the rate contrast at just one value of \(X\).
Why Averaging Predictions Is Not Predicting at an Average
With a nonlinear link, the inverse link function does not generally commute with averaging. Even after random-effects integration, profile-specific response means can differ nonlinearly with \(X\). The standardized prediction averages those response means using \(Q\); evaluating the model at an average covariate value is a different operation. With interactions, profile-specific contrasts can also differ, so the target weights directly affect the overall contrast.
Worked Example: An Interaction Changes the Standardized Contrast
Consider a hypothetical Gaussian identity-link GLMM with random intercept \(B\sim N(0,9)\) and residual variance 16: $$ E(Y\mid A,X,B)=40+5A+8X+4AX+B, $$ where \(Y\) is a measurement in millimetres and \(A,X\in\{0,1\}\). Let the target population assign weight 0.25 to \(X=0\) and 0.75 to \(X=1\). Because \(E(B)=0\), integrating over the random intercept leaves the displayed fixed-effects mean at each profile.
When \(A=0\), the integrated profile means are \(m(0,0)=40\) mm and \(m(0,1)=48\) mm. Thus $$ \Psi_Q(0)=0.25(40)+0.75(48)=10+36=46\text{ mm}. $$ When \(A=1\), the profile means are \(m(1,0)=45\) mm and \(m(1,1)=57\) mm, so $$ \Psi_Q(1)=0.25(45)+0.75(57)=11.25+42.75=54\text{ mm}. $$
The target-standardized mean difference is \(54-46=8\) mm. At \(X=0\), the profile-specific difference is \(45-40=5\) mm; at \(X=1\), it is \(57-48=9\) mm. The standardized difference is also \(0.25(5)+0.75(9)=8\) mm. It depends on the chosen target weights because the model includes an interaction. For example, equal target weights would give a different average contrast, \((5+9)/2=7\) mm.
Response-Scale Integration in a Binary GLMM
For a binary outcome, the standardized prediction is a target-population risk. A logistic GLMM requires integration of the inverse-logit probability over the random-effects distribution before covariate standardization. The following numerical example uses a stated quadrature approximation to make that operation visible.
Worked Example: Standardized Risks Using Numerical Integration
Suppose a hypothetical logistic random-intercept GLMM is $$ \operatorname{logit}\{P(Y=1\mid A,X,B)\} =-1+\log(2)A+\log(3)X+B, \qquad B\sim N(0,0.25). $$ The target population has \(X=0\) with weight 0.60 and \(X=1\) with weight 0.40. For illustration, approximate the normal integral using three-point Gaussian quadrature: evaluate the inverse logit at \(B=0,\sqrt{3}(0.5),-\sqrt{3}(0.5)\) with respective weights \(2/3,1/6,1/6\). This is an approximation to the specified normal random-effects integral, not a change to the target covariate distribution.
At each profile, the calculation is \(m(a,x)\approx\frac{2}{3}\operatorname{logit}^{-1}(\eta)+\frac{1}{6}\operatorname{logit}^{-1}(\eta+0.8660)+\frac{1}{6}\operatorname{logit}^{-1}(\eta-0.8660)\), where \(\eta=-1+\log(2)a+\log(3)x\). Applying this rule gives approximate integrated risks \(m(0,0)=0.2794\), \(m(0,1)=0.5233\), \(m(1,0)=0.4281\), and \(m(1,1)=0.6790\).
For \(A=0\), standardize the two integrated risks: $$ \Psi_Q(0)\approx0.60(0.2794)+0.40(0.5233) =0.16764+0.20932=0.37696\approx0.3770. $$ For \(A=1\), $$ \Psi_Q(1)\approx0.60(0.4281)+0.40(0.6790) =0.25686+0.27160=0.52846\approx0.5285. $$ The standardized risk difference is approximately \(0.5285-0.3770=0.1515\), or 15.15 percentage points. This describes the contrast in risks standardized to the stated \(X\) distribution; it is not a conditional odds ratio.
Assumptions, Diagnostics, and Alternatives
A standardized GLMM prediction is meaningful only relative to its model and target population. The calculation assumes that the conditional response model and random-effects distribution adequately describe the outcome process, and that the covariate profiles assigned positive target weight are within a range where the model predictions are credible. For causal interpretations of contrasts, additional design and identification assumptions are required; standardization alone does not establish causation.
Before reporting results, check that the target distribution is stated clearly, its weights are nonnegative and sum to one, and the response scale and units are identified. Verify the random-effects integration method and its numerical accuracy, especially for nonlinear links or substantial random-effect variation. Examine model fit across the covariate profiles that contribute to the target average, and check for sparse data or extrapolation. A computation can be arithmetically correct while still depending heavily on poorly supported profiles.
The main alternatives answer different questions. A profile-specific marginal prediction reports \(m(a,x)\) at a selected \(x\); it avoids choosing a target distribution but does not summarize a heterogeneous population. A conditional prediction fixes the random effect as well as the covariates, and describes a cluster- or unit-specific conditional mean rather than an average over random effects. A standardized prediction instead specifies \(Q\), integrates over random effects at each profile, and averages over the target population. These quantities need not be equal, particularly with nonlinear links or interactions.
Standardization does not remove model dependence, supply a unique target population, or by itself quantify uncertainty. Different defensible target distributions may produce different marginal summaries, and a target distribution that is not specified makes the estimand ambiguous. Also, integration over random effects does not imply that every target population has the same covariate distribution as the fitting sample. The target distribution must be chosen and communicated for the scientific question at hand.
State the covariates included in \(X\), the target distribution \(Q\), and the conditions \(a\) to compare.
For each condition and covariate profile, calculate the response-scale mean integrated over the stated random-effects distribution.
Weight the profile-specific integrated predictions by \(Q\), then calculate and interpret the requested contrast in context and units.
Check Your Understanding
Use the definitions and examples above. Solutions follow each question.
- A target population has two covariate profiles with weights 0.25 and 0.75. Their integrated predictions under a condition are 10 and 18 units. What is the standardized prediction?
Solution: \(0.25(10)+0.75(18)=2.5+13.5=16\) units. - Why is integrating over random effects not the same operation as averaging over target covariate profiles?
Solution: Random-effects integration averages conditional predictions over the random-effects distribution at a fixed covariate profile. Covariate standardization then averages those profile-specific integrated predictions over \(Q\). - In the Gaussian interaction example, what is the standardized mean difference if the target weights are 0.50 for each value of \(X\)?
Solution: The profile differences are 5 mm and 9 mm, so the standardized difference is \(0.50(5)+0.50(9)=7\) mm. - What is the main error in replacing a weighted average of logistic-model probabilities with a prediction at the average covariate value?
Solution: The inverse-logit function is nonlinear, so in general the weighted average of profile-specific probabilities does not equal the probability calculated at the weighted-average covariate value. - Do standardized predictions from the same fitted GLMM have to agree when their target distributions differ?
Solution: No. The target distribution is part of the estimand, so different distributions can give different standardized predictions and contrasts, especially when profile predictions vary or the model includes interactions.