Tutorials › Generalized Linear Models › Noncollapsibility of Logistic Odds Ratios

Binary Logistic Regression · Tutorial 356 of 981

Noncollapsibility of Logistic Odds Ratios

See how averaging risks across a prognostic covariate can make a marginal odds ratio differ from a common conditional odds ratio, even in a randomized setting.

Intermediate 8 min read

What You'll Learn

  • Distinguish conditional and marginal odds ratios
  • Calculate a marginal odds ratio by averaging probabilities
  • Verify noncollapsibility in a randomized numerical example
  • Prove the direction of the difference for a common odds ratio above one
  • Identify circumstances in which conditional and marginal odds ratios agree
  • Avoid interpreting noncollapsibility as confounding

Why the Same Data Can Give Two Odds Ratios

A logistic regression coefficient for a binary exposure describes an odds ratio conditional on the covariates in the model. A different question is what odds ratio results after averaging the outcome probabilities across those covariates. These two odds ratios need not agree, even when exposure is randomized and there is no confounding by the covariate.

The difference arises because probabilities are averaged first to obtain marginal risks, and then those risks are converted to odds. Since the conversion from probability to odds is nonlinear, averaging does not generally preserve an odds ratio. This property is called noncollapsibility.

Definition: Let \(Y\) be a binary outcome, \(X\) a binary exposure, and \(Z\) a covariate. The conditional odds ratio at \(Z=z\) compares the odds of \(Y=1\) for \(X=1\) with the odds for \(X=0\), holding \(Z=z\) fixed. The marginal odds ratio compares the odds of \(Y=1\) for \(X=1\) and \(X=0\) after averaging each exposure group's outcome probabilities over a specified common distribution of \(Z\).

For this comparison, suppose the conditional odds ratio is a common value \(\theta\) at every value of \(Z\). In a logistic model with no exposure-by-covariate interaction, \(\theta=\exp(\beta)\), where \(\beta\) is the coefficient of \(X\). Write \(p(z)=P(Y=1\mid X=0,Z=z)\). The corresponding probability for \(X=1\) is determined by multiplying the odds by \(\theta\), not by multiplying the probability by \(\theta\).

$$ P(Y=1\mid X=1,Z=z) = \frac{\theta p(z)}{1-p(z)+\theta p(z)}. $$

If exposure and covariate are independent, both exposure groups have the same distribution of \(Z\). The marginal risks are then averages over that shared distribution. This setting lets us isolate noncollapsibility from confounding: the covariate may predict the outcome, but it does not determine who receives the exposure.

A Randomized Example With Different Odds Ratios

Worked Example: A Conditional Odds Ratio of Two

Suppose half the population has \(Z=0\) and half has \(Z=1\). Exposure \(X\) is randomized independently of \(Z\). In the unexposed group, the outcome risks are \(0.10\) for \(Z=0\) and \(0.50\) for \(Z=1\). Assume that at each value of \(Z\), exposure doubles the outcome odds, so the conditional odds ratio is \(\theta=2\).

For \(Z=0\), the unexposed odds are \(0.10/0.90=1/9\). Doubling those odds gives \(2/9\), corresponding to exposed risk \( (2/9)/(1+2/9)=2/11\).

For \(Z=1\), the unexposed odds are \(0.50/0.50=1\). Doubling them gives odds \(2\), corresponding to exposed risk \(2/(1+2)=2/3\). Thus the conditional odds ratio is \(2\) in both covariate strata.

Because the two strata each make up half of each exposure group, the marginal unexposed risk is \( (0.10+0.50)/2=0.30=3/10\). The marginal exposed risk is \( (2/11+2/3)/2=14/33\).

The marginal unexposed odds are \( (3/10)/(7/10)=3/7\), and the marginal exposed odds are \( (14/33)/(19/33)=14/19\). Therefore,

$$ \text{marginal OR} = \frac{14/19}{3/7} = \frac{98}{57} \approx 1.72, $$

which differs from the conditional odds ratio of \(2\). The exposure and covariate are independent, so this difference is not due to confounding. The covariate predicts the outcome, and averaging across its two different baseline risks changes the odds ratio.

Why Averaging Risks Changes the Odds Ratio

To see the mechanism, let \(P=p(Z)\) denote the unexposed risk as \(Z\) varies, and let \(m=E[P]\) be its average under the shared covariate distribution. Define \(h_\theta(p)=\theta p/[1+(\theta-1)p]\). The common conditional odds ratio means the exposed risk at baseline risk \(p\) is \(h_\theta(p)\). Consequently, the marginal exposed risk is \(E[h_\theta(P)]\), whereas the marginal unexposed risk is \(E[P]\).

For \(\theta>1\), the function \(h_\theta\) is strictly concave on the probability interval. That curvature is the mathematical reason the marginal odds ratio falls below the common conditional odds ratio when baseline risks vary.

Theorem: Suppose \(0<P<1\) almost surely, \(E[P]\) is taken over the same covariate distribution for both exposure levels, and the conditional odds ratio is a constant \(\theta>1\). Then the marginal odds ratio is at least \(1\) and at most \(\theta\). It is strictly between \(1\) and \(\theta\) if \(P\) is nonconstant.
1
Express the exposed risk as a function of the baseline risk.
For any \(0<p<1\), multiplying the odds \(p/(1-p)\) by \(\theta\) gives exposed risk \(h_\theta(p)=\theta p/[1+(\theta-1)p]\).
2
Check the curvature.
Differentiating gives \(h_\theta'(p)=\theta/[1+(\theta-1)p]^2\) and \(h_\theta''(p)=-2\theta(\theta-1)/[1+(\theta-1)p]^3<0\). Thus \(h_\theta\) is strictly concave.
3
Apply Jensen's inequality.
Since \(P\) is bounded and \(h_\theta\) is continuous on \([0,1]\), its expectation exists. Jensen's inequality gives \(t=E[h_\theta(P)]\leq h_\theta(E[P])=h_\theta(m)\), with strict inequality when \(P\) is nonconstant.
4
Translate the risk inequality to odds.
The odds function \(r/(1-r)\) is strictly increasing for \(0<r<1\). Also, the odds of \(h_\theta(m)\) equal \(\theta m/(1-m)\). Therefore the odds of \(t\), divided by the odds of \(m\), are at most \(\theta\), strictly less when \(P\) varies.

Finally, \(h_\theta(p)>p\) for every \(0<p<1\) when \(\theta>1\), so \(t>m\). The odds function is increasing, and hence the marginal odds ratio is greater than \(1\). Together these inequalities prove the theorem. \(\square\)

When the Odds Ratios Do Agree

Worked Example: A Covariate That Does Not Predict the Outcome

Suppose the unexposed risk is \(0.20\) in every stratum of \(Z\), and the conditional odds ratio is \(3\). The baseline odds are \(0.20/0.80=1/4\); multiplying by \(3\) gives exposed odds \(3/4\). The exposed risk is therefore \((3/4)/(1+3/4)=3/7\).

Because the risks do not vary with \(Z\), averaging over any distribution of \(Z\) leaves the unexposed risk at \(1/5\) and the exposed risk at \(3/7\). Their odds are \(1/4\) and \(3/4\), respectively, so the marginal odds ratio is \((3/4)/(1/4)=3\). Here the conditional and marginal odds ratios agree because the covariate does not create variation in baseline risk.

Worked Example: Changing the Covariate Distribution

Return to the first example's two baseline risks, \(0.10\) and \(0.50\), and the common conditional odds ratio \(2\). Now suppose \(Z=1\) makes up one quarter of the population, rather than one half. The unexposed marginal risk is \( (3/4)(1/10)+(1/4)(1/2)=1/5\).

The exposed marginal risk is \( (3/4)(2/11)+(1/4)(2/3)=3/22+1/6=10/33\). The unexposed marginal odds are \(1/4\); the exposed marginal odds are \( (10/33)/(23/33)=10/23\). Thus the marginal odds ratio is \( (10/23)/(1/4)=40/23\approx1.74\), still below the conditional value \(2\).

Changing the covariate distribution changes the marginal odds ratio, even though the stratum-specific odds ratio remains \(2\). This is why a marginal odds ratio must be interpreted relative to the population over which the risks were averaged.

Noncollapsibility Is Not Confounding

Confounding concerns a difference in the covariate distribution across exposure groups that affects the comparison. Noncollapsibility can occur even when those distributions are identical. In the randomized example, \(X\) and \(Z\) are independent, yet the marginal and conditional odds ratios differ because odds are a nonlinear transformation of probability.

A useful distinction is that the conditional odds ratio answers a within-covariate-stratum question, while the marginal odds ratio answers a population-average question. Neither calculation is automatically an error or a biased version of the other: they summarize different contrasts. For the theorem above, the shared covariate distribution and a common conditional odds ratio are essential. If the conditional odds ratio varies with \(Z\), a single \(\theta\) does not describe every stratum, and the stated comparison does not apply as written.

Common Pitfall

Incorrect reasoning: “The odds ratio is 2 in every stratum, and exposure is independent of the covariate, so averaging over strata must leave the odds ratio at 2.”

The error is treating odds as though they could be averaged or pooled while preserving their ratio. The marginal risk is the weighted average of stratum-specific probabilities. Only after obtaining that average do we convert it to odds. In general, the odds of an average risk are not the average of stratum-specific odds, and their ratio need not equal the common conditional odds ratio.

The correction is to specify the covariate distribution, average the probabilities for each exposure level over that same distribution, and then calculate the marginal odds ratio from those two averaged risks. This calculation keeps the conditional and marginal estimands distinct.

Key takeaway: A common conditional odds ratio can differ from the marginal odds ratio even without confounding. When the conditional odds ratio exceeds one, baseline risks vary across covariate strata, and both exposure groups are averaged over the same covariate distribution, the marginal odds ratio is closer to one.

Check Your Understanding

Use the definitions and calculations in this tutorial to answer the following.

  1. In a randomized study, why can a prognostic covariate produce different conditional and marginal odds ratios?
  2. If the common conditional odds ratio is greater than one, what does the theorem say about the marginal odds ratio when baseline risks vary?
  3. In the first worked example, which probabilities are averaged before calculating the marginal odds ratio?
  4. Why do the conditional and marginal odds ratios agree in the example where the baseline risk is \(0.20\) in every stratum?
  5. What additional feature would make the theorem in this tutorial inapplicable as stated: a changing covariate distribution across exposure groups, or a conditional odds ratio that varies across strata?
Clinical Biostats