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.
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 level | Risk under treatment 0 | Risk under treatment 1 | Conditional 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,
Under treatment 1,
The marginal odds ratio is
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
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\):
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 level | Treatment | Expected number | Outcome risk | Expected events |
|---|---|---|---|---|
| \(L=0\) | 1 | 1,000 | 0.1818 | 181.8 |
| \(L=0\) | 0 | 4,000 | 0.10 | 400 |
| \(L=1\) | 1 | 4,000 | 0.6667 | 2,666.7 |
| \(L=1\) | 0 | 1,000 | 0.50 | 500 |
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
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
The weighted marginal odds ratio is therefore
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
The marginal odds ratio is
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
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.
Check Your Understanding
Use the definitions and calculations in this tutorial to answer the following questions.
- 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?
- What feature of odds ratios makes averaging risks before calculating odds consequential?
- In the weighting example, what does the treatment weighting change, and what does it leave unchanged about the conditional outcome risks?
- Why does the target population’s distribution of a prognostic covariate matter for a marginal odds ratio?
- In a correctly specified binary-treatment logistic MSM, what population-level contrast does the exponentiated treatment coefficient represent?