Tutorials › Causal Inference › Noncollapsibility in Weighted Logistic MSMs

Marginal Structural Models · Tutorial 750 of 972

Noncollapsibility in Weighted Logistic MSMs

Learn why a weighted logistic MSM estimates a population-marginal odds ratio that can differ from a conditional odds ratio, even when treatment is unconfounded.

Advanced 10 min read

What You'll Learn

  • Distinguish conditional odds ratios from marginal odds ratios in weighted logistic MSMs.
  • Calculate a marginal odds ratio by averaging potential-outcome risks over a target population.
  • Explain why balancing treatment groups does not make odds ratios collapsible.
  • Work through how inverse-probability weighting recovers a marginal contrast when treatment depends on a prognostic covariate.
  • Interpret a logistic MSM coefficient as a contrast between population-averaged risks under specified regimes.

Why a Weighted Logistic MSM Can Give a Different Odds Ratio

Weighting is used in marginal structural models (MSMs) to address treatment-confounder imbalance and, when needed, informative censoring. It can create a weighted population in which treatment histories are independent of measured covariate histories, under the required identification and weight-model assumptions. This does not mean that a logistic regression coefficient from that population must equal a conditional odds ratio from a model that holds covariates fixed.

The reason is noncollapsibility: odds ratios are generally not preserved when conditional outcome risks are averaged over a prognostic covariate. Consequently, a weighted logistic MSM can correctly estimate a marginal causal odds ratio that differs from a conditional odds ratio, even when treatment is randomized or adequately adjusted for. The two odds ratios answer different questions.

Definition: A conditional odds ratio compares outcome odds between treatment levels while holding specified covariates fixed. A marginal odds ratio compares outcome odds after averaging the potential-outcome risks over a specified target population. In a logistic MSM for two regimes, the exponentiated coefficient for their contrast is a marginal odds ratio if the marginal model is correctly specified.

For a binary outcome \(Y\), the risk under regime \(a\) is \(P(Y^a=1)\), where \(Y^a\) is the potential outcome under that regime. Its odds are \(P(Y^a=1)/[1-P(Y^a=1)]\). A marginal odds ratio comparing regimes 1 and 0 is therefore \( \{P(Y^1=1)/[1-P(Y^1=1)]\}/\{P(Y^0=1)/[1-P(Y^0=1)]\} \). For longitudinal treatment, \(a\) can denote a treatment history or regime rather than a single treatment decision.

By contrast, a conditional odds ratio compares odds within levels of a covariate. A conditional logistic model might specify the same treatment odds ratio at every covariate level. Averaging risks from that model and then taking their odds does not generally preserve the conditional odds ratio.

Marginal and Conditional Contrasts in a Randomized Population

First consider a binary baseline covariate \(L\), with equal proportions in its two categories. Suppose treatment is randomized, so treatment is independent of \(L\). The covariate is prognostic: untreated outcome risks differ between its categories. Assume the conditional treatment odds ratio is 2 in both categories.

Worked Example: A Marginal Odds Ratio Below the Conditional Odds Ratio

In a hypothetical randomized population, half the individuals have \(L=0\) and half have \(L=1\). The risks under each treatment level are:

Covariate levelRisk under treatment 0Risk under treatment 1Conditional odds ratio
\(L=0\)0.10\(2/11=0.1818\)2
\(L=1\)0.50\(2/3=0.6667\)2

The conditional odds ratio is 2 at \(L=0\), because the untreated odds are \(0.10/0.90=1/9\) and the treated odds are \((2/11)/(9/11)=2/9\). It is also 2 at \(L=1\): the odds are 1 under treatment 0 and 2 under treatment 1.

Average the risks over the target population, giving each covariate category weight 0.5. Under treatment 0,

$$ P(Y^0=1)=0.5(0.10)+0.5(0.50)=0.30. $$

Under treatment 1,

$$ P(Y^1=1)=0.5\left(\frac{2}{11}\right)+0.5\left(\frac{2}{3}\right) =\frac{14}{33}=0.4242. $$

The marginal odds ratio is

$$ \frac{(14/33)/(19/33)}{0.30/0.70} =\frac{14/19}{3/7} =\frac{98}{57} =1.719. $$

Thus the conditional odds ratio is 2 in each covariate category, whereas the marginal odds ratio is about 1.719. Randomization means there is no treatment confounding by \(L\); the difference arises because the risks are averaged before their odds are calculated. A correctly fitted logistic MSM with treatment as its only predictor targets the marginal contrast, not the covariate-conditional contrast.

Why Averaging Changes the Odds Ratio

The distinction can be seen algebraically when a conditional odds ratio is constant across covariate levels. Let \(p\) be the risk under treatment 0 in one covariate stratum, and let the common conditional odds ratio be \(\theta\). The risk under treatment 1 in that stratum must be

$$ f_\theta(p)=\frac{\theta p}{1-p+\theta p} =\frac{\theta p}{1+(\theta-1)p}. $$

To obtain the marginal risks, average \(p\) and \(f_\theta(p)\) over the target population. In general, the average of \(f_\theta(p)\) is not \(f_\theta\) evaluated at the average of \(p\). Since odds are a nonlinear function of risk, averaging first and then calculating odds does not preserve the within-stratum odds ratio.

For \(\theta>1\), the function is strictly concave over \(0<p<1\):

$$ f_\theta''(p) = \frac{-2\theta(\theta-1)} {\left[1+(\theta-1)p\right]^3} <0. $$

By concavity, \(E\{f_\theta(p)\}\leq f_\theta\{E(p)\}\), with strict inequality when the untreated risks vary across covariate strata with positive population weights. Also, \(f_\theta(p)>p\) for \(0<p<1\) when \(\theta>1\). Because the odds function \(r/(1-r)\) increases with risk, these inequalities imply that, with a common conditional odds ratio above 1, the marginal odds ratio is above 1 but below \(\theta\) when the baseline risks vary. The analogous direction reverses for a common conditional odds ratio below 1.

This derivation describes noncollapsibility; it does not require confounding. If there is no prognostic variation in baseline risk across the population, the conditional and marginal odds ratios coincide. With variation, the size of the difference depends on the distribution of baseline risks as well as on the conditional effect.

What Weighting Does—and Does Not Do

Under consistency, exchangeability given the measured treatment history, positivity, and correctly specified treatment and censoring weight models where applicable, weighting can identify marginal potential-outcome risks for specified regimes. In the weighted population, treatment histories are balanced with respect to the covariates used to construct the weights. The outcome model in an MSM then describes a population-level contrast across regimes.

Weighting does not turn a marginal odds ratio into a conditional odds ratio, and it does not make odds ratios collapsible. It also does not guarantee that the chosen marginal model is correct: for example, a model that imposes one treatment contrast across times or covariate-defined target populations may fail to represent the true marginal risks. The target population and the regime contrast must be clear when interpreting the fitted coefficient.

A simple weighted calculation shows how confounding can be addressed while the distinction between conditional and marginal odds ratios remains.

Worked Example: Weighting to Recover the Marginal Contrast

Suppose a hypothetical observational population has 10,000 individuals, with 5,000 in each of the two \(L\) categories. Treatment is more likely for \(L=1\): the treatment probabilities are 0.20 for \(L=0\) and 0.80 for \(L=1\). Let the outcome risks within each \(L\) category be those in the first worked example. Thus \(L\) predicts both treatment and outcome, so the unweighted comparison can be confounded.

The following expected counts follow from those probabilities and risks. Fractional event counts are expected counts in this hypothetical population, not claims about realized individual data.

Covariate levelTreatmentExpected numberOutcome riskExpected events
\(L=0\)11,0000.1818181.8
\(L=0\)04,0000.10400
\(L=1\)14,0000.66672,666.7
\(L=1\)01,0000.50500

Use unstabilized inverse-probability treatment weights: for treatment 1, the weight is \(1/P(A=1\mid L)\), and for treatment 0 it is \(1/P(A=0\mid L)\). In the treatment-1 group, the \(L=0\) weight is \(1/0.20=5\) and the \(L=1\) weight is \(1/0.80=1.25\). The weighted totals are 5,000 in each stratum, or 10,000 overall. The weighted event total is

$$ 5(181.8)+1.25(2666.7)=909.0+3333.4=4242.4, \qquad \widehat{P}_w(Y=1\mid A=1)=\frac{4242.4}{10000}=0.4242. $$

In the treatment-0 group, the weights are \(1/0.80=1.25\) for \(L=0\) and \(1/0.20=5\) for \(L=1\). Again, the weighted total is 10,000, with 5,000 represented in each covariate stratum. The weighted event total is

$$ 1.25(400)+5(500)=500+2500=3000, \qquad \widehat{P}_w(Y=1\mid A=0)=\frac{3000}{10000}=0.3000. $$

The weighted marginal odds ratio is therefore

$$ \frac{0.4242/(1-0.4242)}{0.3000/(1-0.3000)} \approx \frac{0.7369}{0.4286} =1.719. $$

The calculation recovers the target-population marginal contrast under the stated assumptions. It does not recover the conditional odds ratio of 2. Weighting has restored the target distribution of \(L\) across treatment groups; it has not changed the fact that the marginal risks must be averaged before converting them to odds.

How the Target Population Affects the Marginal Odds Ratio

A marginal odds ratio is defined relative to a population distribution. Even if the same conditional odds ratio applies at every covariate level, changing the proportions of those levels can change the marginal contrast. The following example keeps the stratum-specific risks fixed but changes the target population.

Worked Example: Changing the Covariate Distribution

Suppose only 20% of a hypothetical target population has \(L=1\), and 80% has \(L=0\). Retain the conditional risks from the first example, so the conditional odds ratio remains 2 in both strata. The marginal risks are

$$ P(Y^0=1)=0.8(0.10)+0.2(0.50)=0.1800, $$
$$ P(Y^1=1)=0.8\left(\frac{2}{11}\right)+0.2\left(\frac{2}{3}\right) =\frac{46}{165}=0.2788. $$

The marginal odds ratio is

$$ \frac{(46/165)/(119/165)}{0.18/0.82} = \frac{46/119}{9/41} \approx 1.761. $$

This is different from the marginal odds ratio of 1.719 in the equal-proportion population, even though the conditional risks within each stratum did not change. The marginal contrast depends on the covariate distribution over which risks are averaged. A weighted MSM estimate should therefore be interpreted for the population represented by its weighting and standardization scheme.

Interpreting the Fitted Logistic MSM

For a binary treatment contrast, a logistic MSM may be written as

$$ \operatorname{logit}\{P(Y^a=1)\}=\beta_0+\beta_1a, \qquad a\in\{0,1\}. $$

Here \(\beta_0\) is the log odds of the population-marginal risk under treatment 0, and \(\beta_1\) is the log of the marginal odds ratio comparing treatment 1 with treatment 0. Thus \(\exp(\beta_1)\) is not, just by virtue of being estimated with weights, a conditional odds ratio given the covariates in the weight models. For multiple treatment histories or regimes, a coefficient contrast must be translated into the corresponding comparison of their modeled marginal log odds.

For example, in the equal-proportion population above, the fitted two-regime contrast has \(\beta_1=\log(1.719)\approx0.5423\), not \(\log(2)\approx0.6931\). The marginal interpretation is that the odds of the outcome under treatment 1, averaged over that target population, are about 1.719 times the odds under treatment 0. It does not say that each individual’s odds increase by that factor, nor that the odds ratio is 1.719 within each covariate stratum.

When a logistic MSM includes additional terms, its coefficients describe the marginal model as specified. A coefficient intended to be a common contrast across regimes needs that model structure to represent the relevant marginal risks adequately. The marginal-versus-conditional distinction remains: a weighted MSM coefficient is read from the marginal model, while a conditional odds ratio comes from a model that conditions on covariates.

Common Mistake

Wrong reasoning: “The treatment weights balanced the covariates, so the weighted logistic treatment coefficient must equal the covariate-adjusted conditional odds ratio.”

Correction: Balance addresses the treatment assignment mechanism in the weighted population; it does not make odds ratios collapsible. A correctly specified weighted logistic MSM estimates a marginal contrast between risks averaged over the target population. A conditional odds ratio instead compares treatment odds while holding covariates fixed. As the worked calculations show, these contrasts can differ even in a randomized population with no confounding.

Key takeaway: Weighting can support identification of marginal causal risks under its assumptions, but it does not erase noncollapsibility. Interpret a weighted logistic MSM contrast as an odds ratio between population-averaged risks for the specified regimes and target population, not automatically as a conditional odds ratio.

Check Your Understanding

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

  1. In the first worked example, why does the marginal odds ratio differ from 2 even though the conditional odds ratio equals 2 in both covariate strata?
  2. What feature of odds ratios makes averaging risks before calculating odds consequential?
  3. In the weighting example, what does the treatment weighting change, and what does it leave unchanged about the conditional outcome risks?
  4. Why does the target population’s distribution of a prognostic covariate matter for a marginal odds ratio?
  5. In a correctly specified binary-treatment logistic MSM, what population-level contrast does the exponentiated treatment coefficient represent?
Clinical Biostats