class: center, middle, inverse, title-slide .title[ # Causal Inference (2) ] .author[ ### Yue Jiang ] .date[ ### STA 440 / Spring 25 ] --- ### Exchangeability We saw last time that if mean exchangeability (and causal consisteny) hold, then `$$E(Y^{a = 1}) - E(Y^{a = 0}) = E(Y | A = 1) - E(Y | A = 0)$$` (and similarly for odds ratios and risk ratios, etc.). Thus, in randomized experiments, we know that association is in fact causation, as randomizing treatment is sufficient for mean exchangeability, since the potential outcomes are MCAR in a (marginally) randomized experiment. --- ### Conditionally randomized experiments <img src="img/gods4.png" width="30%" style="display: block; margin: auto;" /> --- ### Conditionally randomized experiments We saw last time that we did *not* have (mean) exchangeability in these data. The counterfactual outcomes would have been different if the treatment assignments were swapped. --- ### Conditionally randomized experiments Suppose there is some baseline covariate `\(L\)`, for instance `\(L = 1\)` if the individual is in critical condition at baseline. We might consider a .vocab[conditionally randomized] experiment: perhaps we randomly assign 3/4 of the patients for which `\(L = 1\)` to treatment, and only 1/2 of patients for which `\(L = 0\)`. .question[ Why will we **not** have exchangeability for such an experiment? ] --- ### Conditionally randomized experiments We see that the "sicker" patients at baseline were more likely to receive treatment; if they were more likely to die if they did *not* receive treatment, then we see that (mean) exchangeability is violated (their potential outcomes under the opposite treatment would not be the same on average). However, we can view this as two separate marginal experiments: one among the sicker patients `\(L = 1\)`, and one among the less sick patients, `\(L = 0\)`. We have .vocab[conditional exchangeability] (for `\(a, l = 0, 1\)`): `$$Y^{a} \perp A | L.$$` --- ### Conditionally randomized experiments We might be able to view this as potential outcomes being MAR instead - if we were able to know L, then we would be able to control for it somehow and make value inferences: conditional on `\(L\)`, expected potential outcomes are the same regardless of what treatment the patient received (we can swap them out with no difference in expected potential outcomes). --- ### Conditionally randomized experiments `\begin{align*} E(Y^a) &= \sum_{l \in \mathscr{L}} E(Y^a | L = l)P(L = l)\\ &= \sum_{l \in \mathscr{L}} E(Y^a | A = a, L = l)P(L = l)\\ &= \sum_{l \in \mathscr{L}} E(Y | A = a, L = l)P(L = l) \end{align*}` by conditional exchangeability and causal consistency. Again, the right side of the equation is fully identifiable from observed data - this is just a weighted average. --- ### Conditionally randomized experiments Thus, we know that this weighted average, the .vocab[standardized mean], is the counterfactual expectation if in fact all patients received treatment `\(a\)`. We can define causal risk estimands, such as the risk difference `$$E(Y^{a = 1}) - E(Y^{a = 0})$$` and estimate them with observed data: `$$\sum_l E(Y | L = l, A = 1)P(L = l) - E(Y | L = l, A = 0)P(L = l)$$` --- ### Inverse probability weighting <img src="img/tree1.png" width="50%" style="display: block; margin: auto;" /> Where the probabilities from left to right are `\(P(L)\)`, `\(P(A | L)\)`, and `\(P(Y | A, L)\)` and the numbers at the end are the observed data. .question[ For those with `\(L = 0\)`, what is the expected death count, `\(\#Y = 0\)`, under conditional exchangeability if no one receives treatment? ] --- ### Inverse probability weighting What if no one received treatment in the two groups (left)? what if everyone received treatment in the two groups (right)? These counterfactual populations are below: <img src="img/tree2.png" width="100%" style="display: block; margin: auto;" /> .question[ What are `\(P(Y^{a = 1} = 1)\)` and `\(P(Y^{a = 0} = 1)\)`? ] --- ### Inverse probability weighting `\(P(Y^{a = 0} = 1)\)` is the counterfactual risk of death if no one got treatment. We know that 4 out of 8 individuals with `\(L = 0\)` were untreated and 1 died, and so if all 8 didn't get treatment, then 2 would have died. Similarly, 3 out of 12 individuals with `\(L = 1\)` were untreated and 2 died; thus 8 would have died if all 12 didn't get treatment. -- We are assuming that for those patients with `\(L = 0\)` that were treated, they would have the same probability of death as those were actually untreated: **this is conditional exchangeability** (conditional on `\(L = 0\)`). --- ### Inverse probability weighting The two trees are essentially simulations of counterfactual worlds where everyone is untreated/treated, which are valid under conditional exchangeability. Let's combine the two counterfactual worlds into one pseudo-population in which each individual appears twice: once receiving treatment and once not receiving treatment. -- Given conditional exchangeability in the *original* population, `\(Y^a \perp A | L\)`, then in the pseudo-population we have *unconditional* exchangeability, and can thus make causal statements given association results. --- ### Inverse probability weighting <img src="img/tree3.png" width="100%" style="display: block; margin: auto;" /> --- ### Inverse probability weighting Consider the 4 untreated individuals with `\(L = 0\)` in the original population. These individuals were used to create the 8 members of the pseudo-population (each of them receives a weight of 1/0.5 = 2; 0.5 is the conditional probability of being untreated given `\(L = 0\)`). -- Similarly, the 9 treated individuals with `\(L = 1\)` in the original population correspond to the 12 members of the pseudo-population (each of them receives a weight of 1/0.75; 0.75 is the conditional probability of receiving treatment given `\(L = 1\)`). -- We weigh each individual by the inverse of the conditional probability of receiving the treatment that they actually got. This is .vocab[inverse probability weighting]. --- ### Inverse probability weighting As it turns out, IP weighting is the same as standardization, assuming that `\(P(A = a | L = l)\)` is positive for all non-zero `\(P(L = l)\)`, which is guaranteed to hold in conditionally randomized experiments (this is a fairly standard homework problem in causal inference courses). -- What are the differences? IPW uses the conditional probability of treatment `\(A\)` given the covariate `\(L\)` whereas standardization uses the direct probability of the covariate `\(L\)` and the conditional probability of the outcome `\(Y\)` given `\(A\)` and `\(L\)`. --- ### Inverse probability weighting Since these techniques simulate counterfactual worlds in which `\(L\)` was *not* used to decide the probability of treatment, we can say that such methods .vocab[adjust] or .vocab[control] for `\(L\)`. .vocab[ Why did we care about conditionally randomized experiments when marginally randomized experiments are all we really need? ] --- ### Observational studies We will connect the notion of a conditionally randomized experiment to an observational study. The two can be thought of as the same thing under the following conditions: - .vocab[Exchangeability]: the conditional probability of receiving every value of treatment, though perhaps not decided by the investigators, depends *only* on the measured covariates - .vocab[Positivity]: the conditional probability of receiving every value of treatment is positive - .vocab[Causal consistency]: the values of the treatment under comparison correspond to well-defined interventions --- ### Exchangeability In most observational studies when treatments are not randomly assigned by investigators, exchangeability is unlikely to hold (doctors tend to give the sickest patients transplants). However, we might be willing to assume that *conditional* exchangeability holds given covariates `\(L\)` (*given* a patient's critical condition status, we might believe that doctors randomly assign hearts to patients). .vocab[ Is it possible to test this? ] --- ### Exchangeability No! (why not?) -- We would need to assess whether `\(P(Y^{a} = 1 | A = a, L = l)\)` is equal to `\(P(Y^a = 1 | A \neq a, L = l)\)`, but we never get to observe the latter. In practice, for observational studies we often rely on expert/scientific knowledge to select the set of covariates such that conditional exchangeability is reasonable. Note that we will not have conditional exchangeability if there are unmeasured variables `\(U\)` where the probability of receiving treatment depends on `\(U\)` given `\(L\)` - if we have .vocab[unmeasured confounders], we will not hvae conditional exchangeability. --- ### Unmeasured confounders Suppose doctors are unwilling to give smokers transplants: `\(U = 1\)`. We know that smoking is also predictive of death `\(Y^a\)` and treatment `\(A\)` within levels of `\(L\)`, since doctors are less likely to give a smoker a heart transplant compared to a non-smoker with the same seriousness of disease. Since we don't know a patient's smoking status, we cannot use it for standardization or IP weighting, and thus in general will get invalid results. --- ### Positivity Positivity means that `\(P(A = a | L = l) > 0\)` for all `\(l\)` where `\(P(L = l) > 0\)`. That is, we don't have any area of the covariate space where the probability of treatment is 0 or 1. We have positivity in our example because there are individuals who are both treated and untreated for all levels of the covariate `\(L\)` (critical status). Luckily, we *can* often assess whether positivity is reasonable. However, positivity would *not* hold if someone with critical condition always gets the treatment, for instance (otherwise, how might we construct that counterfactual world under conditional exchangeability?). --- ### Well-defined interventions Well-defined interventions goes back to SUTVA - there are only two potential outcomes, one for each level of treatment. However, "transplant" might mean different things - different surgeons, different hospitals, etc. These versions of treatment might result in different potential outcomes. The relevant assumption we are making (besides causal consistency) is that we have .vocab[treatment-variation irrelevance]: that the different "types" of treatment are irrelevant to the potential outcome (e.g., you might die when receiving a transplant regardless of who the surgeon is). --- ### Ok, what if the conditions are violated? There are always associational conclusions!