23 Marginal Structural Models
In summary, if there are no unmeasured confounders given data on \(L_0\), one can control confounding (due to \(L_0\)) by modifying the crude analysis by weighting each subject \(i\) by \(w_i\). The denominator of \(w_i\) is informally the probability that a subject had his her own observed treatment. (Robins, Hernán, and Brumback 2000)
We can calculate the causal effect of an exposure \(X\) on a disease outcome \(D\) by stratifying on a set of covariates \(C\) sufficient to control confounding and selection bias, calculating the stratum-specific risks, and standardizing. The basic idea of standardization is to calculate the effect of treatment in a population where the exposed and the unexposed have the same distribution of \(C\). Without standardization, the risk of disease in each exposure group is: \[ \begin{aligned} & \Pr(D = 1 \given{} X = x, S = 1) \nonumber \\ &\qquad = \sum_c \Pr(D = 1 \given{} C = c, X = 1, S = 1) \Pr(C = c \given{} X = x, S = 1), \end{aligned} \tag{23.1}\] where the sum is over the possible values \(c\) of the confounder \(C\). Because of the term \(\Pr(C = c \given{} X = x, S = 1)\) on the right, the distribution of \(C\) can differ across exposure groups.
When we standardize, we replace \(\Pr(C = c \given{} X = x, S = 1)\) in Equation 23.1 with a \(\Prstd(C = c)\) that is the same in both exposure groups. The standardized risk of disease is \[ \Prstd(D = 1 \given{} X = x) = \sum_c \Pr(D = 1 \given{} C = c, X = x, S = 1) \Prstd(C = c). \tag{23.2}\] When conditioning on \(C\) is sufficient to control confounding and selection bias, this standardized risk can be interpreted as the causal risk of disease \(\Prstd(D^x = 1)\) if we intervened to set \(X = x\) in the standard population. The corresponding standardized risk differences, risk ratios, odds ratios, or cumulative hazard ratios are estimates of the causal effect of \(X\) on \(D\) in the standard population. These measures of causal effect can depend on the distribution of \(C\) that we choose as the standard.
Standardization does not work well when the number of possible combinations of values of covariates in \(C\) is large. Truett, Cornfield, and Kannel (1967) gave an example where almost 600,000 participants would be needed to have a denominator of at least 10 in each of the \(3^{10} = 59{,}049\) strata defined by 10 variables with three levels each. The bias-variance tradeoff is staring us in the face: If we let each level of \(C\) define a separate stratum, we could end up with high variance in our risk estimates, which would lead to high variance in the standardized risks. If we group levels of \(C\), we might get residual confounding within these combined strata.
23.1 Inverse probability of treatment weighting
Another way to standardize is to weight each individual in the population and then calculate a marginal measure of association (i.e., a measure that is not conditional on \(C\)) in the weighted population, which is often called the pseudopopulation (Horvitz and Thompson 1952; Rosenbaum 1987; Robins, Hernán, and Brumback 2000). In the pseudopopulation, there is no association between \(C\) and \(X\), so all treatment groups have the same distribution of \(C\) and the marginal measure of association has a causal interpretation like that from a randomized trial. It is important to note that this approach only works if conditioning on the covariates in \(C\) is sufficient to control for confounding and selection bias.
To understand these weights, we will think of them in three steps. Suppose we have a study sample with \(n\) individuals. If we weight each person by the inverse probability weight \[ \ipw(x, c) = \frac{1}{\Pr(X = x, C = c \given{} S = 1)}, \] then the number of individuals with \(X = x\) and \(C = c\) in the pseudopopulation is \[ n \Pr(X = x, C = c \given{} S = 1) \frac{1}{\Pr(X = x, C = c \given{} S = 1)} = n, \] so all combinations of \(X\) and \(C\) are equally likely in the pseudopopulation. This creates a pseudopopulation that has a copy of the study sample within each combination of \(X\) and \(C\) , so there is no confounding of the association between treatment \(X\) and death \(D\) by \(C\). Table 23.1 shows the population from the example in Simpson (1951) with weights \(\ipw(x, c)\). All combinations of treatment \(X\) and biological sex \(C\) have 52 individuals. In the pseudopopulation, there is no confounding of the association between treatment \(X\) and death \(D\) by biological sex: Within each biological sex, the probability of treatment is \(1 / 2\), so the pseudopopulation is like the population of a randomized trial.
| Male | Female | |||
| Weights | Treated | Untreated | Treated | Untreated |
| 13 | 7 | 27 | 5 | |
| \(\ipw(x, c)\) | 52 | 52 | 52 | 52 |
| \(\iptw(x, c)\) | 20 | 20 | 32 | 32 |
| \(\siptw(x, c)\) | 15.38 | 4.62 | 24.62 | 7.38 |
The next step is to make the pseudopopulation have the same distribution of \(C\) has the study sample. The inverse probability of treatment weight (IPT weight or IPTW) is \[ \iptw(x, c) = \frac{\Pr(C = c \given{} S = 1)}{\Pr(X = x, C = c \given{} S = 1)} = \frac{1}{\Pr(X = x \given{} C = c, S = 1)}. \tag{23.3}\] In the resulting pseudopopulation, the number of individuals with \(X = x\) and \(C = c\) is \[ n \Pr(X = x, C = c \given{} S = 1) \frac{\Pr(C = c \given{} S = 1)}{\Pr(X = x, C = c \given{} S = 1)} = n \Pr(C = c \given{} S = 1), \] so this the pseudopopulation has a copy of the study sample within each treatment group. Table 23.1 shows the pseudopopulation based on \(\iptw(x, c)\) in the example from Simpson (1951). Each treatment group has 32 females and 20 males, which matches the sex distribution in the study sample. In the pseudopopulation, there is no confounding of the association between treatment \(X\) and death \(D\) by biological sex \(C\): Within each biological sex, the probability of treatment is \(1 / 2\). Again, the pseudopopulation is like the population of a randomized trial.
A common source of confusion is to think that the IPTW is the inverse probability of being treated or exposed, which is the meaning of “probability of treatment” in the context of the propensity score from Chapter 22. For inverse probability of treatment weights, “probability of treatment” means the probability of receiving the treatment that you got. If you are exposed, it is the conditional probability of being exposed given your covariate values. If you are unexposed, it is the conditional probability of being unexposed given your covariate values.
23.1.1 Stabilized IPT weights
Finally, we can make the pseudopopulation have the same distribution of both \(X\) and \(C\) as the study sample while ensuring that they remain independent. The stabilized IPT weight is \[ \begin{aligned} \siptw(x, c) &= \Pr(X = x \given{} S = 1) \times \iptw(x, c) \\ &= \frac{\Pr(X = x \given{} S = 1)}{\Pr(X = x \given{} C = c, S = 1)} \\ &= \frac{\Pr(X = x \given{} S = 1) \Pr(C = c \given{} S = 1)}{\Pr(X = x, C = c \given{} S = 1)}. \end{aligned} \tag{23.4}\] In the final expression, the denominator is the probability that \(X = x\) and \(C = c\) in the study sample and the numerator \[ \Pr(X = x \given{} S = 1) \Pr(C = c \given{} S = 1) \] is the probability that \(X = x\) and \(C = c\) if \(X\) and \(C\) are independent but have the same marginal distributions as in the study sample. If \(X\) and \(C\) are independent in the study sample, the stabilized weights equal one and the pseudopopulation is a copy of the study sample.
Table 23.1 shows the pseudopopulation based on \(\siptw(x, c)\) for the example in Simpson (1951). As in the study sample, the pseudopopulation has 32 females, 20 males, 40 treated individuals, and 12 untreated individuals. In the pseudopopulation, there is no confounding of the association between treatment \(X\) and death \(D\) by biological sex: Within each biological sex, the probability of treatment is \(40 / 52 \approx 0.769\), which is the overall probability of treatment in the study sample.
In simple examples where \(C\) defines a small number of strata, both unstabilized and stabilized IPT weights give exactly the same results. When a regression model1 is used to estimate the risk of disease in the pseudopopulation as is done in marginal structural models (Robins, Hernán, and Brumback 2000; Hernán, Brumback, and Robins 2000), the stabilized weights usually give smaller standard errors. In practice, the stabilized weights should always be used.
23.1.2 Propensity scores and IPT weights
The propensity score \[ \pi(c) = \Pr(X = 1 \given{} C = c, S = 1) \] is the conditional probability of being treated given \(C = c\) (Rosenbaum and Rubin 1983). In Chapter 22, we saw that propensity scores can be used control confounding and selection bias via matching or stratifying by the propensity score or by including the propensity score as a predictor in an outcome regression model. They can also be used to calculate inverse probability of treatment weights. However, please note the difference in the definition of “treatment” in the two settings:
For propensity scores, “treatment” means being in the group defined as treated or exposed.
For IPT weights, “treatment” means the treatment that each individual received whether they are in the treated (or exposed) group or the untreated (or unexposed) group.
The unstabilized IPT weight is \[ \frac{1}{\Pr(X = x \given{} C = c, S = 1)} = \begin{cases} \frac{1}{\pi(c)} &\text{for a treated individual,}\\[4pt] \frac{1}{1 - \pi(c)} &\text{for an untreated undividual}, \end{cases} \] where \(\pi(c) = Pr(X = 1 \given{} C = c, S = 1)\) is the propensity score. The stabilized IPT weight is \[ \frac{\Pr(X = x \given{} S = 1)}{\Pr(X = x \given{} C = c, S = 1)} = \begin{cases} \frac{\Pr(X = 1 \given{} S = 1)}{\pi(c)} &\text{for a treated individual,}\\[4pt] \frac{\Pr(X = 0 \given{} S = 1)}{1 - \pi(c)} &\text{for an untreated undividual}. \end{cases} \]
23.1.3 IPT weighting and standardization
Let \(\Pr()\) denote probabilities in the eligible population, and let \(\Pr^*()\) denote probabilities calculated in the pseudupopulation created by the stabilized IPT weights. When exchangeability (no confounding) and the analytic cohort condition (no selection bias) hold given \(C\), we have \[ \Pr(D^x = 1 \given{} C = c) \nonumber \\ = \Pr(D = 1 \given{} X = x, C = c, S = 1) \] by conditional exchangeability given \(C\), the analytic cohort condition given \(C\), and consistency (see Equation 17.4). Up to sampling variation, the conditional risk of disease given \(X = x\) and \(C = c\) in the study sample equals the causal risk that we would get in the \(C = c\) stratum of the eligible population if we intervened to set \(X = x\). In the pseudopopulation created by the weights \(w(x, c)\), the conditional risk of death given \(X = x\) and \(C = c\) is \[ \begin{aligned} \Pr\nolimits^*(D = 1 \given{} X = x, C = c) &= \frac{\Pr^*(D = 1, X = x, C = c)}{\Pr^*(X = x, C = c)} \\ &= \frac{\Pr(D = 1, X = x, C = c \given{} S = 1) \times w(x, c)}{\Pr(X = x, C = c \given{} S = 1) \times w(x, c)} \\ &= \Pr(D = 1 \given{} X = x, C = c, S = 1) \end{aligned} \] where \(w(x, c)\) could be the stabilized IPT weights, unstabilized IPT weights, or any other set of weights that depends only on \(x\) and \(c\). Combining these results, we get \[ \Pr(D^x = 1 \given{} C = c) = \Pr\nolimits^*(D = 1 \given{} X = x, C = c). \] Up to sampling variation, the conditional risks of disease given \(X\) and \(C\) in the pseudopopulation equal the conditional causal risks given \(C\) in the eligible population.
The marginal risk of disease given \(X = x\) in the pseudopopulation is \[ \begin{aligned} \Pr\nolimits^*(D = 1 \given{} X = x) &= \sum_c \Pr\nolimits^*(D = 1 \given{} X = x, C = c) \Pr\nolimits^*(C = c) \\ &= \sum_c \Pr(D = 1 \given{} X = x, C = c, S = 1) \Pr(C = c \given{} S = 1). \end{aligned} \] The last expression is the risk of disease standardized to the distribution of \(C\) in the study sample. Up to sampling variation, this standardized risk equals the causal risk of disease in the study sample if we intervened to set \(X = x\). Using \(\Pr^*(D = 1 \given{} X = 1)\) and \(\Pr^*(D = 1 \given{} X = 0)\), we can calculate the standarized risk difference, risk ratio, odds ratio, or cumulative hazard ratio for the study sample. The same result holds if we use the unstabilized weights. If conditioning on \(C\) is sufficient to control confounding and selection bias, these can be interpreted as causal risks and measures of causal effect.
Inverse probability weighting can be used to standardize to any distribution of \(C\) (Sato and Matsuyama 2003). To get a measure of association standardized to a distribution \(\Prstd(C = c)\), we can use the stabilized weights \[ \begin{aligned} w_\std(x, c) &= \frac{\Pr(X = x \given{} S = 1) \Pr_\std(C = c)} {\Pr(X = x, C = c \given{} S = 1)} \\ &= \frac{\Pr(X = x \given{} S = 1) \Pr_\std(C = c)} {\Pr(X = x \given{} C = c, S = 1) \Pr(C = c \given{} S = 1)}. \end{aligned} \tag{23.5}\] This creates a pseudopopulation with the standard distribution of \(C\) and the same distribution of \(X\) as the study sample. If we let \(\Prstd(C = c) = \Pr(C = c \given S = 1)\), then we get the stabilized IPT weights. Because these weights depend only on \(X\) and \(C\), the conditional risk of disease given \(X\) and \(C\) is the same in the pseudopopulation and the study sample. Because the numerator of the weight is a product of a probability involving only \(X\) and a probability involving only \(C\), \(X\) and \(C\) are independent in the pseudopopulation. Let \(\Pr^*()\) represent probabilities in the pseudopopulation created by these weights. The marginal risk of disease given \(X = x\) in the pseudopopulation is \[ \begin{aligned} \Pr\nolimits^*(D = 1 \given{} X = x) &= \sum_c \Pr\nolimits^*(D = 1 \given{} X = x, C = c) \Pr\nolimits^*(C = c \given{} X = x) \\ &= \sum_c \Pr(D = 1 \given{} X = x, C = c, S = 1) \Prstd(C = c) \end{aligned} \] because \(\Pr^*(C = c \given{} X = x) = \Prstd(C = c)\) in all treatment groups. As before, we can calculate standardized risks in the study sample by calculating marginal risks in the pseudopopulation.
This approach can be used to estimate causal risks and effects in the treated, in the controls, or in the study sample. If we let \(\Prstd(C = c) = \Pr(C = c \given{} X = 1, S = 1)\) in Equation 23.5 and rearrange to express everything in terms of the propensity score, we get the weights \[ w_\text{treated} = \begin{cases} \frac{\pi(c)}{1 - \pi(c)} &\text{if } x = 0, \\ 1 &\text{if } x = 1. \end{cases} \] Sato and Matsuyama (2003) calls these the SMR weights where SMR stands for standardized morbidity ratio. If we let \(\Prstd(C = c) = \Pr(C = c \given{} X = 0, S = 1)\) and rearrange, we get the weights \[ w_\text{control}(x, c) = \begin{cases} \frac{1 - \pi(c)}{\pi(c)} &\text{if } x = 0, \\ 1 &\text{if } x = 1. \end{cases} \] In a cohort study where selection depends on exposure, the conditional distribution of \(C\) given \(X\) is more scientifically meaningful than the marginal distribution of \(C\) in the study sample.
23.2 Simpson’s paradox reweighted
To illustrate the use of IPT weights, we will use them to analyze the example of confounding Simpson (1951). The Table 15.1 shows the number of deaths among males, among females, and in both sexes. The effect of treatment is confounded by sex because women are more likely to be treated and more likely to die. Treatment reduces the risk of death within each sex, but it appears to have no marginal effect on risk of death in the study sample.
23.2.1 Standardized risks
The proportion male in the study sample is \(20 / 52 \approx 0.385\), and the proportion female is \(32 / 52 \approx 0.555\). The conditional risks of death given treatment and biological sex are given in Section 17.3.2. If we use the distribution of biological sex in the study sample as out standard population, the standardized risk of death in the treated is \[ \frac{5}{13} \times \frac{20}{52} + \frac{15}{27} \times \frac{32}{52} \approx 0.490 \] and the standardized risk of death in the untreated is \[ \frac{3}{7} \times \frac{20}{52} + \frac{3}{5} \times \frac{32}{52} \approx 0.534. \] We could use these risks to calculate measures of associaton such as a risk difference, risk ratio, odds ratio, or cumulative hazard ratio. Assuming the DAG in Figure 15.6 is true, these are unbiased estimates of the causal risk that would occur if we intervened to set \(X = 1\) or \(X = 0\), respectively, in the study sample.
23.2.2 Pseudopopulation based on unstabilized IPTW
Among males, the probability of being treated is \(13 / 20 = 0.65\). The unstabilized IPT weight for treated males is \[ \iptw(1, \text{male}) = \frac{20}{13} \approx 1.54, \] and the unstabilized IPT weight for untreated males is \[ \iptw(0, \text{male}) = \frac{20}{7} \approx 2.86. \] Among females, the probability of being treated is \(27 / 32 \approx 0.84\). The unstabilized IPT weight for treated females is \[ \iptw(1, \text{female}) = \frac{32}{27} \approx 1.19, \] and the unstabilized IPT weight for untreated females is \[ \iptw(0, \text{female}) = \frac{32}{5} = 6.4. \] The resulting pseudopopulation is shown in Table 23.2. There are 52 treated people and 52 untreated people, and there are 20 males and 32 females within each treatment group.
| Male | Female | Combined | ||||
| Treated | Untreated | Treated | Untreated | Treated | Untreated | |
| Dead | 7.69 | 8.57 | 17.78 | 19.2 | 25.47 | 27.77 |
| Alive | 12.31 | 11.43 | 14.22 | 12.8 | 26.53 | 24.23 |
In this pseudopopulation, the marginal risk of death in the treated is \[ \frac{20 / 13 \times 5 + 32 / 27 \times 15} {20 / 13 \times (5 + 8) + 32 / 27 \times (15 + 12)} \approx \frac{25.47}{52} \approx 0.490. \] The marginal risk of death in the untreated is \[ \frac{20 / 7 \times 3 + 32 / 5 \times 3} {20 / 7 \times (3 + 4) + 32 / 5 \times (3 + 2)} \approx \frac{27.77}{52} \approx 0.534. \] These are exactly the same as the risks of death standardized to the sex distribution in the study sample. Thus, all possible measures of association are also the same.
23.2.3 Pseudopopulation based on stabilized IPTW
Among males, the probability of being treated is \(13 / 20 = 0.65\). The treated proportion of the study sample is \(40 / 52 \approx 0.77\), and the untreated portion is \(12 / 52 \approx 0.23\). The stabilized IPT weight for treated males is \[ \siptw(1, \text{male}) = \frac{40}{52} \times \frac{20}{13} \approx 1.18, \] and the unstabilized IPT weight for untreated males is \[ \siptw(0, \text{male}) = \frac{12}{52} \times \frac{20}{7} \approx 0.66. \] Among females, the probability of being treated is \(27 / 32 \approx 0.84\). The unstabilized IPT weight for treated females is \[ \siptw(1, \text{female}) = \frac{40}{52} \times \frac{32}{27} \approx 0.91, \] and the unstabilized IPT weight for untreated females is \[ \siptw(0, \text{female}) = \frac{12}{52} \times \frac{32}{5} = 1.48. \] The resulting pseudopopulation is shown in Table 23.3. Ignoring small errors introduced by rounding to two decimal places, there are a total of 52 people of which 26 are treated, 26 are untreated, 20 are male, and 32 are female. To three decimal points, there are 5.917 treated males and 13.675 treated females who died, which produces a total of 19.592 treated deaths.
| Male | Female | Combined | ||||
| Treated | Untreated | Treated | Untreated | Treated | Untreated | |
| Dead | 5.92 | 1.98 | 13.68 | 4.43 | 19.59 | 6.41 |
| Alive | 9.47 | 2.64 | 10.94 | 2.95 | 20.41 | 5.59 |
In the pseudopopulation created by the stabilized weights, marginal risk of death in the treated is \[ \frac{(40 / 52 \times 20 / 13) \times 5 + (40 / 52 \times 32 / 27) \times 15} {(40 / 52 \times 20 / 13) \times (5 + 8) + (40 / 52 \times 32 / 27) \times (15 + 12)} \approx \frac{19.59}{40} \approx 0.490 \] and the marginal risk of death in the untreated is \[ \frac{(12 / 52 \times 20 / 7) \times 3 + (12 / 52 \times 32 / 5) \times 3} {(12 / 52 \times 20 / 7) \times (3 + 4) + (12 / 52 \times 32 / 5) \times (3 + 2)} \approx \frac{6.41}{12} \approx 0.534. \] Because the probability of each treatment status cancels out of the numerator and denominator, these risks are exactly the same as the unstabilized IPTW risks and the standardized risks. It follows that all three methods produce exactly the same measures of association in this simple example.
The stabilized weights go from \(0.66\) (untreated men) to \(1.48\) (untreated women), whereas the unstabilized weights go from \(0.60\) (treated women) to \(3.20\) (untreated women). True to their name, the stabilized weights vary less than the unstabilized weights. The pseudopopulation generated by the unstabilized weights had 104 individuals, but the pseudopopulation generated by the stabilized weights had 52 individuals just like the original study sample. Thus, the average unstabilized weight equals 2 and the average stabilized weight equals 1.
23.2.4 Pseudopopulation based on IPTW for the treated
Specifically, a nonsaturated regression model. A saturated regression model is one where there is each unique combination of the covariates has an estimated coefficient or intercept. For example, a model for \(k\) groups that has \(k - 1\) dummy variables is saturated.↩︎