class: center, middle, inverse, title-slide .title[ # Intro to Causal Inference ] .author[ ### Yue Jiang ] .date[ ### STA 440 / Spring 25 ] --- <br><br><br><br> <img src="img/olympus.jpg" width="100%" style="display: block; margin: auto;" /> .question[ Who is depicted here? ] --- ### Potential outcomes For now, we will consider a treatment `\(A\)` taking on values of 0 or 1, and an outcome `\(Y\)` taking on values 0 or 1. Define a .vocab[potential outcome] `\(Y^{a = 1}\)` as the outcome that *would be observed* if treatment `\(a = 1\)` was given (this might not have happened in reality). `\(Y^{a = 0}\)` is the potenetial outcome that would be observed if treatment `\(a = 0\)` was given. These potential outcomes are known as .vocab[counterfactuals]. Before treatment `\(A\)` happens, there are two potential outcomes. After `\(A\)` happens, then a counterfactual exists. --- ### Counterfactuals You've likely dealt with counterfactuals your whole life! - What if I stayed in bed this morning? - What if we shot better during the Elite 8 game? - What if I didn't take that Tylenol? - If this patient got a liver transplant 3 years ago, would they sitll have been alive now? --- ### Potential outcomes <img src="img/gods.png" width="30%" style="display: block; margin: auto;" /> (A famous (and very reproduced) table from Hernan and Robins) --- ### Individual vs. average causal effects <img src="img/gods.png" width="30%" style="display: block; margin: auto;" /> .question[ What does it mean to have an individual "causal effect"? What about an average causal effect? ] --- ### Individual causal effects In this table, we see that some benefit, some are harmed, some are "immune," and some are "doomed." Consider the individual potential outcomes `\(Y_i^{a = 1}\)` and `\(Y_i^{a = 0}\)` for the `\(i\)`th observation. For individual `\(i\)`, we say that `\(A\)` has an effect on `\(Y\)` if `\(Y_i^{a = 1} \neq Y_i^{a = 0}\)`. .question[ The .vocab[sharp null hypothesis] states that there is no effect for *all* individuals. What does it mean for `\(A\)` to have no effect on `\(Y\)` in the language of potential outcomes? ] --- ### Individual causal effects The sharp null hypothesis states that `\(Y_i^{a = 1} = Y_i^{a = 0}\)` for all `\(i\)`. We will also introduce .vocab[causal consistency], which states that the observed outcome `\(Y\)` is related to the observed treatment and counterfactuals by `\(Y = Y^{a = 1}A + Y^{a = 0}(1 - A)\)`. --- ### Individual causal effects We usually care about some difference in potential outcomes, for instance `\(Y_i^{a = 1} - Y_i^{a = 0}\)`. .question[ Is it possible to identify individual causal effects from the observed data `\(Y\)` and `\(A\)` for observation `\(i\)`? ] --- ### Quick aside: variability So far, we've assumed that potential outcomes are deterministic based on the treatment, but note that we could (somewhat) straightforwardly define potential outcomes probabilistically as well. --- ### Potential outcomes vs. observed data <img src="img/gods2.png" width="60%" style="display: block; margin: auto;" /> --- ### Some assumptions .vocab[Infererence] occurs when one individual's treatment affects the outcome of another individual. Having no interference is an important part of SUTVA (next slide). .question[ What are some examples of interference? ] --- ### Some assumptions The .vocab[Stable Unit Treatment Value Assumption] (SUTVA) essentially states that there are only two potential outcomes: there is no interference, and that there is only one version of treatment and one version of non-treatment (or that multiple versions of each of these are irrelevant). .vocab[ What is an example of having multiple "versions" of treatment? How about an example where this is irrelevant? Why would SUTVA be important philosophically? ] --- ### Average causal effects Let's now move on to average causal effects, defined in terms of expectations. An .vocab[average causal effect] exists in the population if `\(E(Y^{a = 1}) \neq E(Y^{a = 0})\)`. We say there is no average causal effect if `\(E(Y^{a = 1}) = E(Y^{a = 0})\)`. .question[ Does having no average causal effect imply the sharp null? Does the sharp null imply no average causal effect? Explain why or provide counterexamples. ] --- ### Causal vs. associational effects We might care about various measures of causal effects, such as causal risk differences, odds ratios, etc. These are defined in terms of potential outcomes. *Associational* effects are based on observed data. E.g.: - Causal risk difference: `\(E(Y^{a = 1}) \neq E(Y^{a = 0})\)` - *Associational* risk difference: `\(E(Y | A = 1) - E(Y|A = 0)\)` .question[ When we might we be able to claim an association is actually causation? ] --- ### Causal vs. associational effects (that's the whole point of causal inference!) --- ### A quick calculation <img src="img/gods3.png" width="40%" style="display: block; margin: auto;" /> --- ### A quick calculation .vocab[ What is `\(P(Y^{a = 0} = 1 | A = 1)\)`? What is `\(P(Y^{a = 0} = 1 | A = 0)\)`? What is the implication of this? ] <img src="img/gods.png" width="30%" style="display: block; margin: auto;" /> --- ### A quick calculation Those that received treatment were at higher risk of death than the untreated in the counterfactual world in which no one receives treatment. .question[ But we don't get to observe the counterfactuals. What then? What can we do? ] --- ### Exchangeability .vocab[Exchangeability] is the property that the counterfactual outcome and actual treatment received are independent for all `\(a\)`: `\(Y^a \perp A\)` (note that like "causal consistency," "exchangeability" does not have the usual probabilistic definition of exchangeability). Be careful, this does *not* mean `\(Y \perp A\)` (in fact, we probably wouldn't want this at all for many studies!). --- ### Exchangeability Here, exchangeability implies that we can "exchange" group assignment without altering the outcome. For instance, if in the treatment group you have sicker patients than another, we will not have exchangeability - if they instead got placebo instead, our results would be different. > *When the groups of exposed and unexposed are exchangeable, the risk of the outcome in the treated group would have been the same as the risk of the outcome in the untreated group had the treatment been switched between the groups* .right[--Hernan] --- ### Exchangeability Similarly, .vocab[mean exchangeability] is a weaker, but analogous property on the expectations: `\(E(Y^a | A = 1) = E(Y^a | A = 0)\)` (exchangeability implies mean exchangeability). .question[ Why is (mean) exchangeability important? Did we have exchangeability in the example earlier? Why or why not? ] --- ### Exchangeability Mean exchangeability means that `\(E(Y^{a = 1}) = E(Y^{a = 1} | A = 1)\)`, which by causal consistency is equal to `\(E(Y | A = 1)\)` (which *is* identifiable). Similarly, it means that `\(E(Y^{a = 0}) = E(Y | A = 0)\)`. .vocab[ What is the implication of this fact? ] --- ### Exchangeability Under exchangeability the causal risk difference (and risk ratio and odds ratio) equal the associational risk difference (or risk ratio or odds ratio). .question[ How might we introduce exchangeability to a study? ] --- ### 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!