Tutorials › Generalized Linear Mixed Models (GLMM) › Marginal Effects At Representative Covariate Values

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

Marginal Effects At Representative Covariate Values

You will learn to define an integrated effect at a representative covariate profile, choose profiles that are meaningful and supported by the data, and distinguish these estimates from population-standardized averages.

Advanced 10 min read

What You'll Learn

  • Define an integrated prediction and contrast at a specified covariate profile
  • Choose representative profiles with clear scientific meaning and adequate data support
  • Calculate profile-based marginal probabilities and treatment contrasts
  • Distinguish a profile-specific estimate from an average standardized to a target population
  • Diagnose unsupported, implausible, or overly selective profiles
  • Explain what profile-based estimates do and do not represent

What a Representative-Profile Estimate Means

A marginal effect can depend on the covariate profile at which it is evaluated. A treatment contrast for a 40-year-old participant with low baseline severity need not match the contrast for an older participant with high severity. Reporting an effect at a representative profile makes the covariate values explicit, but it does not automatically make that effect representative of an entire population.

In a generalized linear mixed model, the response distribution is specified conditional on the random effects. For cluster \(j\), let \(Y_{ij}\) be the response for observation \(i\), let \(x_{ij}\) and \(z_{ij}\) be the fixed- and random-effects design vectors, and let \(b_j\) be the cluster random-effects vector. A standard formulation is

$$ E(Y_{ij}\mid b_j,x_{ij},z_{ij})= h(x_{ij}^{\mathsf T}\beta+z_{ij}^{\mathsf T}b_j), \qquad h=g^{-1}, \qquad b_j\sim N(0,D). $$

Here \(g\) is the link function, \(\beta\) is the fixed-effects parameter vector, and \(D\) is the random-effects covariance matrix. The response distribution and link must be appropriate for the outcome, and the specified random-effects distribution must be a defensible model for the target clusters. The calculations below concern predictions for a new cluster, integrating over this random-effects distribution rather than conditioning on an estimated effect for a particular observed cluster.

Definition: For a covariate profile \(c\) and exposure or treatment setting \(a\), an integrated prediction is the model-based mean response after averaging the conditional mean over the random-effects distribution: $$ m(a,c)=\int h\{x(a,c)^{\mathsf T}\beta+z(a,c)^{\mathsf T}b\}\,dF_b(b). $$ A profile-based contrast compares such predictions at the same specified covariate profile, for example \(m(1,c)-m(0,c)\) for a binary response. The profile \(c\) is held fixed; the random effects are integrated out.

The integral is part of the estimand, not a claim that every cluster has the same random effect. In practice, estimated parameters and numerical integration are used to calculate it. These calculations presume that the fitted model and random-effects distribution are suitable for the target of inference, and that the chosen profile is meaningful for that target.

Choosing and Describing Profiles

A useful representative profile is selected for a reason that can be stated in context. It may describe a scientifically important subgroup, a common clinical presentation, or a prespecified combination of covariate values. Continuous variables should have specified values and units; categorical variables should be assigned actual levels. If a profile combines covariate values rarely or never observed together, its prediction may rely heavily on model extrapolation.

A profile may also use a covariate mean, but means do not always describe an actual or meaningful individual. For instance, the mean of a binary indicator is a proportion, not a category that a person possesses. Likewise, a profile formed by combining separate covariate means may be poorly supported even when each mean is individually within its observed range. State the values and explain why the combination is relevant.

There are two distinct ways to summarize predictions. A profile-specific contrast reports the contrast at one chosen \(c\). A collection of profiles can instead be averaged using specified weights \(w_k\), where \(w_k\geq 0\) and \(\sum_k w_k=1\). That average is

$$ \sum_{k=1}^{K} w_k\{m(1,c_k)-m(0,c_k)\}. $$

This is an average over the chosen profiles and weights. It equals a covariate-standardized population contrast only when those profiles and weights represent the target covariate distribution as intended. Empirical standardization, discussed in the earlier material on empirical standardization with observed covariates, averages over the target observations’ covariate values; a small hand-picked set of profiles is not a substitute for that distribution unless its weights and construction justify the substitution.

Worked Example: Contrasting Treatment at Two Age Profiles

Suppose a hypothetical binary-outcome GLMM has a random intercept \(b\) that equals \(-1\) or \(1\) with probability \(1/2\) each. Its conditional model is $$ P(Y=1\mid b,\text{age},A)= \operatorname{logit}^{-1}\{-2+0.5A+0.04(\text{age}-50)+b\}, $$ where \(A=1\) denotes treatment and age is measured in years. Calculate the integrated treatment contrast at ages 40 and 70.

The assumed two-point random-effects distribution is the integration rule for this hypothetical example. At each profile, keep age fixed, calculate the response probability at both random-intercept values, and average those two probabilities. At age 40 without treatment, the fixed part of the predictor is \(-2+0.04(40-50)=-2.4\). Thus $$ m(0,40)=\frac{\operatorname{logit}^{-1}(-3.4)+\operatorname{logit}^{-1}(-1.4)}{2} \approx \frac{0.0323+0.1978}{2}=0.1151. $$

With treatment, the fixed part becomes \(-1.9\), so $$ m(1,40)=\frac{\operatorname{logit}^{-1}(-2.9)+\operatorname{logit}^{-1}(-0.9)}{2} \approx \frac{0.0522+0.2891}{2}=0.1706. $$ The age-40 risk difference is \(0.1706-0.1151=0.0555\), or about 5.55 percentage points.

At age 70, the untreated fixed part is \(-2+0.04(70-50)=-1.2\), and the treated fixed part is \(-0.7\). Therefore $$ m(0,70)=\frac{\operatorname{logit}^{-1}(-2.2)+\operatorname{logit}^{-1}(-0.2)}{2} \approx \frac{0.0998+0.4502}{2}=0.2750, $$ $$ m(1,70)=\frac{\operatorname{logit}^{-1}(-1.7)+\operatorname{logit}^{-1}(0.3)}{2} \approx \frac{0.1545+0.5744}{2}=0.3645. $$ The age-70 risk difference is approximately \(0.3645-0.2750=0.0895\), or 8.95 percentage points. These are two profile-specific integrated contrasts. Neither is, by itself, the average treatment contrast for a population with a mixture of ages.

Profile Estimates and Standardized Averages

A profile-based estimate answers a focused question: what does the fitted model predict for the specified covariate values, after integration over random effects? A standardized estimate answers a different question: what is the average model prediction over a defined distribution of covariates, under each treatment setting? The target covariate distribution and its weights are part of the latter estimand.

The distinction matters even when all profiles are observed. Giving equal weight to four selected profiles defines an equally weighted four-profile average, not necessarily an average for the observed population. If the target population contains different proportions of those profiles, population weights will generally give a different result. The earlier material on choosing the covariate distribution for standardization establishes why that target must be specified.

Worked Example: Correctly Averaging Four Observed Profiles

Consider a hypothetical logistic random-intercept model with linear predictor $$ \eta=-1+0.1(\text{age}-50)+1.5S+0.5A+b, $$ where \(S\) is a binary severity indicator, \(A\) is treatment, and \(b=-0.8\) or \(0.8\) with equal probability. Four equally weighted covariate profiles are \((30,0),(40,0),(60,1),(80,1)\), with age in years. The four profiles and equal weights are stipulated as the target for this calculation.

For untreated participants, the four fixed predictors are \(-3,-2,1.5,3.5\). For example, at age 60 and \(S=1\), the predictor is \(-1+0.1(60-50)+1.5=1.5\); at age 80 and \(S=1\), it is \(-1+0.1(80-50)+1.5=3.5\). Treatment adds \(0.5\), giving treated predictors \(-2.5,-1.5,2,4\).

For any fixed predictor \(\eta\), integration over the two random-intercept values gives $$ F(\eta)=\frac{\operatorname{logit}^{-1}(\eta-0.8)+\operatorname{logit}^{-1}(\eta+0.8)}{2}. $$ The untreated integrated predictions are \(F(-3)\approx0.0608\), \(F(-2)\approx0.1444\), \(F(1.5)\approx0.7885\), and \(F(3.5)\approx0.9618\). Their equally weighted average is $$ \frac{0.0608+0.1444+0.7885+0.9618}{4}\approx0.4889. $$

The treated integrated predictions are \(F(-2.5)\approx0.0950\), \(F(-1.5)\approx0.2115\), \(F(2)\approx0.8556\), and \(F(4)\approx0.9763\). Their average is $$ \frac{0.0950+0.2115+0.8556+0.9763}{4}\approx0.5346. $$ The equally weighted four-profile risk difference is \(0.5346-0.4889=0.0457\), or about 4.57 percentage points. This is a standardized contrast for the explicitly defined four-profile distribution. It is not automatically a population average for some broader population, and it is not the contrast at any one of the four profiles.

A Single Profile Can Hide Meaningful Variation

When an effect changes with covariates, one profile cannot summarize that variation. A model with treatment-by-age interaction, for example, may yield different profile-specific treatment contrasts across ages. Even without an interaction in the conditional linear predictor, integrated response-scale contrasts can vary across profiles because the response function is nonlinear. The profile-specific predictions remain useful, but their scope should be clear.

Sometimes a scientifically central profile is not the same as the average profile in a population. The model prediction at mean age and mean severity, for example, is generally not the same quantity as the average prediction over the population’s actual ages and severity values. Use a profile when the question concerns that profile; use a defined covariate distribution when the question concerns an average over that distribution.

Worked Example: A Corrected Age-40 Profile Contrast

In a hypothetical binary-outcome model, suppose that at age 40 and reference severity the untreated fixed predictor is \(-1.4\), and treatment adds \(0.75\). Let the random intercept be \(-0.8\) or \(0.8\) with equal probability. Calculate the integrated risks and the profile-specific risk difference.

For the untreated profile, the two complete predictors are \(-1.4-0.8=-2.2\) and \(-1.4+0.8=-0.6\). Hence $$ m(0,40)=\frac{\operatorname{logit}^{-1}(-2.2)+\operatorname{logit}^{-1}(-0.6)}{2} \approx\frac{0.0998+0.3543}{2}=0.2270. $$

Under treatment, the fixed predictor is \(-1.4+0.75=-0.65\), so the two complete predictors are \(-1.45\) and \(0.15\). Thus $$ m(1,40)=\frac{\operatorname{logit}^{-1}(-1.45)+\operatorname{logit}^{-1}(0.15)}{2} \approx\frac{0.1900+0.5374}{2}=0.3637. $$ The risk difference is \(0.3637-0.2270=0.1367\), or 13.67 percentage points. This describes the integrated model contrast at the stated age and severity profile; it does not estimate the population-standardized risk difference without a separate choice of target covariate distribution.

Diagnostics, Limitations, and Common Pitfalls

Before interpreting a representative-profile estimate, check both the profile and the calculation. Confirm that the selected values are within the data’s support, that their combination is plausible, and that the target random-effects distribution is appropriate. For numerical integration, verify that the integration method is stable enough for the desired precision. For estimated models, uncertainty in fitted parameters also contributes uncertainty in the reported prediction or contrast; integration over random effects alone does not account for that estimation uncertainty.

  • Unsupported profile: A prediction for an unusual combination of covariates may be extrapolative even if each value separately occurs in the data. Inspect joint support, not just individual ranges.
  • Ambiguous reference: State the category or value used for every covariate held fixed. “Typical patient” is not precise unless the profile is defined.
  • Unclear averaging: If several profiles are combined, state their weights and the population they are intended to represent.
  • Overgeneralization: A contrast for one profile does not establish the same contrast for other profiles. Consider whether covariate-specific contrasts differ materially.
  • Confusing uncertainty sources: The random-effects integration defines the marginal prediction for a new cluster. It is not a confidence interval and does not, by itself, quantify uncertainty from estimating model parameters.

The main alternative to presenting selected profiles is to report predictions standardized over an explicit target covariate distribution. That approach directly targets an average over that distribution, but depends on its definition and representation. Profile-based estimates are often more transparent for clinically or scientifically meaningful cases, while a standardized average is more directly aligned with a population-level average question. Neither approach removes model misspecification, lack of covariate support, or uncertainty about the target population.

Key takeaway: Name the covariate profile, integrate predictions over the stated random-effects distribution, and describe the result as profile-specific. Call an estimate population-standardized only when its covariate values and weights represent a clearly defined target distribution.

Check Your Understanding

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

  1. A binary GLMM gives integrated risks of 0.18 under control and 0.25 under treatment at a specified profile. What is the risk difference, and what population does it describe?
  2. Two profiles have risk differences of 0.04 and 0.12. If they receive equal weights, what is their weighted average contrast? What additional information is needed to call it a population-standardized contrast?
  3. Why might a profile using the mean of a binary covariate be difficult to interpret?
  4. A model gives a risk difference of 0.06 at age 50. Can this be reported as the average risk difference for all ages? Explain.

Solutions. (1) The risk difference is \(0.25-0.18=0.07\), or 7 percentage points. It describes the stated profile after the model’s random-effects integration, not an unspecified population average. (2) The equal-weight average is \((0.04+0.12)/2=0.08\), or 8 percentage points. To call it population-standardized, the two profiles and equal weights must represent the intended target covariate distribution. (3) A binary variable’s mean is a proportion, such as 0.4, not an individual category; use a meaningful category or explain a deliberate averaging scheme. (4) No. The estimate is at age 50. An average over ages requires a target age distribution and predictions evaluated and averaged over that distribution.

Clinical Biostats