Tutorials › Generalized Linear Mixed Models (GLMM) › Marginal Odds Ratios And Noncollapsibility

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

Marginal Odds Ratios And Noncollapsibility

Learn how to calculate and interpret conditional and marginal odds ratios in a binary GLMM, and why averaging over random intercepts generally moves the marginal odds ratio toward one.

Advanced 10 min read

What You'll Learn

  • Define conditional and marginal odds ratios for a binary random-intercept GLMM.
  • Integrate cluster-specific probabilities to obtain marginal risks and odds.
  • Calculate a marginal odds ratio using numerical quadrature.
  • Explain odds-ratio noncollapsibility using concavity and Jensen’s inequality.
  • Distinguish noncollapsibility from confounding and identify assumptions behind the comparison.
  • Recognize when conditional and marginal odds ratios coincide and how to report each estimand.

Why Two Odds Ratios Can Describe the Same GLMM

In a binary generalized linear mixed model, a treatment coefficient in a logistic model describes a comparison at a fixed value of the random effect. A population-averaged odds ratio instead compares probabilities after averaging over the random-effect distribution. Because averaging probabilities and then converting them to odds is not the same as averaging odds, the two odds ratios generally differ.

This difference is called noncollapsibility. It can arise even when treatment is independent of the random effect, so it is not by itself evidence of confounding or bias. The distinction matters when interpreting model coefficients: a conditional odds ratio and a marginal odds ratio answer different questions.

Definition: For a binary outcome \(Y\), binary exposure \(X\), and random intercept \(b\), consider the logistic random-intercept model $$ Y\mid X=x,b \sim \operatorname{Bernoulli}\{p(x,b)\},\qquad \operatorname{logit}\{p(x,b)\}=\beta_0+\beta_1x+b,\qquad b\sim N(0,\sigma_b^2). $$ The conditional odds ratio comparing \(X=1\) with \(X=0\) at the same \(b\) is \(\exp(\beta_1)\). The marginal probability at exposure level \(x\) is \(p_x=E_b[p(x,b)]\), and the marginal odds ratio is \(\{p_1/(1-p_1)\}/\{p_0/(1-p_0)\}\). Here the expectation integrates over the specified random-intercept distribution.

The model assumes that, conditional on \(X\) and \(b\), the outcome has the stated Bernoulli probability and logistic mean; clusters share their random intercept; and the random intercept has mean zero and variance \(\sigma_b^2\) with the specified normal distribution. To interpret the comparison as averaging treatment and control over the same population of clusters, the distribution of \(b\) must be the same for both exposure levels. In the simple model above, that is the usual random-effects independence assumption: the exposure is independent of \(b\). If exposure groups have different random-effect distributions, their marginal contrast also reflects that difference in composition.

From Conditional to Marginal Odds

At a fixed \(b\), the odds of the outcome are \(\exp(\beta_0+\beta_1x+b)\). Therefore the conditional odds ratio is $$ \frac{\exp(\beta_0+\beta_1+b)}{\exp(\beta_0+b)}=\exp(\beta_1). $$ It is constant across clusters. But the marginal calculation is different: first find the probability at each \(b\), then average those probabilities. Only after averaging do we convert the risks to odds.

Worked Example: Integrating a Normal Random Intercept

Suppose a hypothetical model has \(\beta_0=-1.5\), \(\beta_1=\log(3)\), and \(\sigma_b=1\). The conditional odds ratio is \(\exp\{\log(3)\}=3\). To approximate each marginal probability, use five-point quadrature for a standard normal random intercept. The nodes \(z\) are \(0,\pm1.3556,\pm2.8570\), with respective weights \(0.53333, 0.22208, 0.01126\) (each nonzero node has the same weight as its negative). The random-intercept values are \(b=z\), since \(\sigma_b=1\).

For \(X=0\), the conditional probabilities at \(b=0,\pm1.3556,\pm2.8570\) are approximately \(0.1824, 0.4640, 0.0544, 0.7954, 0.0127\), respectively. Thus

$$ p_0\approx 0.53333(0.1824) +0.22208(0.4640+0.0544) +0.01126(0.7954+0.0127) \approx 0.2215. $$

For \(X=1\), add \(\log(3)\) to each linear predictor. The corresponding probabilities are approximately \(0.4010, 0.7220, 0.1472, 0.9211, 0.0370\), in the same node order. Therefore

$$ p_1\approx 0.53333(0.4010) +0.22208(0.7220+0.1472) +0.01126(0.9211+0.0370) \approx 0.4177. $$

The marginal odds are approximately \(0.2215/(1-0.2215)=0.2845\) for \(X=0\), and \(0.4177/(1-0.4177)=0.7174\) for \(X=1\). Hence the marginal odds ratio is approximately \(0.7174/0.2845=2.521\), compared with the conditional odds ratio of 3. In this hypothetical population, the exposure is associated with higher outcome odds under both summaries, but the population-averaged odds ratio is closer to one.

Why the Marginal Odds Ratio Moves Toward One

A short argument shows the source and direction of noncollapsibility when there is a common conditional odds ratio. Let \(q\) be the outcome probability at exposure \(X=0\) for a randomly selected stratum, where a stratum can represent a value of the random intercept. Suppose the conditional odds ratio is \(\theta>1\). The probability at \(X=1\) in that stratum is

$$ f(q)=\frac{\theta q}{1-q+\theta q} =\frac{\theta q}{1+(\theta-1)q}. $$

Let \(\mu=E(q)\), so the marginal risks are \(p_0=\mu\) and \(p_1=E\{f(q)\}\). The function \(f\) is concave on \(0\leq q\leq1\), because

$$ f''(q)= \frac{-2\theta(\theta-1)} {\{1+(\theta-1)q\}^3}<0. $$

By Jensen’s inequality for a concave function, \(E\{f(q)\}\leq f\{E(q)\}\). Since odds increase with probability, this inequality implies

$$ \frac{p_1}{1-p_1} \leq \frac{f(\mu)}{1-f(\mu)} = \theta\frac{\mu}{1-\mu}. $$

Dividing both sides by the unexposed marginal odds gives \(\operatorname{OR}_{\mathrm{marginal}}\leq\theta\). If \(q\) varies across strata with positive probability, strict concavity gives a strict inequality. Thus a common conditional odds ratio greater than one is generally attenuated toward one after averaging. When the common conditional odds ratio is below one, the analogous result puts the marginal odds ratio between that value and one.

The argument requires a common conditional odds ratio and the same distribution of strata in the two exposure groups. In the random-intercept model with a fixed exposure effect, these conditions hold when the random-effect distribution is common across exposure levels. If the random effect has no variation, or if the baseline risk \(q\) is constant across strata, equality holds: there is no heterogeneity over which to average.

Worked Example: A Two-Stratum Illustration

Consider a hypothetical population with two equally weighted strata. The unexposed risks are \(0.10\) and \(0.50\), and the conditional odds ratio is 2 in each stratum. The unexposed marginal risk is \((0.10+0.50)/2=0.30\), with odds \(0.30/0.70=3/7\).

An odds ratio of 2 converts a baseline risk \(q\) to \(2q/(1-q+2q)\). The exposed risks are therefore \(2/11\approx0.1818\) in the first stratum and \(2/3\approx0.6667\) in the second. Averaging these exact risks gives

$$ p_1=\frac{1}{2}\left(\frac{2}{11}+\frac{2}{3}\right) =\frac{14}{33}. $$

The exposed marginal odds are \((14/33)/(19/33)=14/19\). Keeping exact fractions until the final step, the marginal odds ratio is

$$ \operatorname{OR}_{\mathrm{marginal}} =\frac{14/19}{3/7} =\frac{98}{57} \approx 1.719. $$

Although each stratum has a conditional odds ratio of 2, the marginal odds ratio is about 1.719. The difference arises from averaging risks across strata with different baseline risks, not from a change in the stratum-specific odds ratio.

Worked Example: When the Two Odds Ratios Coincide

Suppose every cluster has the same unexposed risk, \(q=0.25\), and the conditional odds ratio is 3. The exposed risk is

$$ p_1=\frac{3(0.25)}{1-0.25+3(0.25)} =\frac{0.75}{1.50}=0.50. $$

The unexposed odds are \(0.25/0.75=1/3\), and the exposed odds are \(0.50/0.50=1\). Their ratio is \(1/(1/3)=3\), equal to the conditional odds ratio. This is a collapsible case because there is no variation in baseline risk across the strata being averaged.

Interpretation, Inference, and Model Checks

A conditional odds ratio describes the comparison for two individuals or occasions with the same random-intercept value, under the model. A marginal odds ratio describes the comparison between the two exposure settings after averaging their predicted probabilities over the chosen random-effect distribution. The latter is not obtained by simply exponentiating \(\beta_1\); it requires integrating the predicted probabilities and then forming the odds ratio.

For inference on a marginal odds ratio, uncertainty in all parameters used in the integration matters, including \(\beta_0\), \(\beta_1\), and \(\sigma_b^2\). A confidence interval for \(\exp(\beta_1)\) is an interval for the conditional odds ratio, not automatically for the marginal odds ratio. The marginal estimate and its interval can be obtained by applying the integration and odds-ratio calculation to parameter estimates and propagating their joint uncertainty, for example with a suitable delta-method calculation or a parametric bootstrap.

Useful checks include confirming that numerical integration is sufficiently accurate, that predicted probabilities remain between zero and one, and that the random-intercept distribution and its independence from exposure are defensible for the target comparison. A large difference between the two odds ratios is not, by itself, a model failure: it may reflect substantial heterogeneity in baseline risk. However, a marginal calculation based on a different random-effect distribution for each exposure group does not isolate the common-population comparison used in the derivation above.

A conditional GLMM and a population-averaged approach such as generalized estimating equations target different summaries. The GLMM specifies cluster-level random effects and yields conditional coefficients; a population-averaged analysis targets marginal associations under its own modeling and working-correlation choices. Neither odds ratio is universally preferable. The scientific question determines which estimand is useful, and the reported result should state explicitly whether it is conditional or marginal.

Common Pitfalls and Limitations

  • Calling noncollapsibility confounding. The conditional and marginal odds ratios can differ even when exposure is independent of the random effect. Confounding concerns differences in exposure-group composition related to outcome risk; noncollapsibility can occur without such differences.
  • Averaging odds instead of probabilities. To obtain a marginal odds ratio, integrate the predicted probabilities first, then convert each averaged probability to odds. Averaging stratum-specific odds does not produce the defined marginal odds.
  • Reporting \(\exp(\beta_1)\) as population-averaged. In the logistic random-intercept model, \(\exp(\beta_1)\) is conditional on the random effect. It generally differs from the marginal odds ratio.
  • Ignoring the target population. Marginal probabilities depend on the distribution over which the random effects are integrated. Different target distributions can yield different marginal odds ratios.

The Jensen argument has specific scope: it applies to a common conditional odds ratio and a shared distribution of baseline risks. Random slopes, exposure-dependent random-effect distributions, or other departures from these conditions require a direct calculation for the estimand at hand; the simple attenuation conclusion need not apply unchanged. Odds ratios are also scale-dependent summaries, so the gap between conditional and marginal values should not be read as a direct measure of model quality.

Key takeaway: In a logistic random-intercept GLMM, \(\exp(\beta_1)\) is the conditional odds ratio. The marginal odds ratio is obtained by integrating probabilities over the random-effect distribution before forming odds. With a shared distribution and heterogeneous baseline risks, noncollapsibility generally moves the marginal odds ratio toward one.

Check Your Understanding

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

  1. A logistic random-intercept model has \(\beta_1=\log(4)\). What is the conditional odds ratio, and does this alone determine the marginal odds ratio?
  2. For a common conditional odds ratio greater than one, what feature of the baseline risks makes the marginal odds ratio strictly smaller than the conditional odds ratio?
  3. Two equally weighted strata have unexposed risks \(0.20\) and \(0.20\), with a common conditional odds ratio of 2. Find the marginal odds ratio.
  4. Why is a difference between conditional and marginal odds ratios not, by itself, proof of confounding?

Solutions. (1) The conditional odds ratio is \(\exp\{\log(4)\}=4\). This coefficient alone does not determine the marginal odds ratio; the intercept, random-effect distribution and variance, and integration are also needed. (2) Baseline-risk heterogeneity makes \(q\) vary across strata. The function \(f(q)=\theta q/\{1+(\theta-1)q\}\) is strictly concave for \(\theta>1\), so Jensen’s inequality gives a strict difference when \(q\) is nonconstant. (3) The common baseline risk is \(0.20\), so there is no variation in \(q\). Under odds ratio 2, the exposed risk is \(2(0.20)/(0.80+2(0.20))=1/3\). Its odds are \(1/2\), while the unexposed odds are \(0.20/0.80=1/4\); the ratio is 2. (4) Noncollapsibility can arise solely because odds are nonlinear in risk and risks are averaged across heterogeneous strata. Confounding is not required when exposure groups share the same stratum distribution.

Clinical Biostats