Video 5 of 6

Closing backdoor paths

A simulated dataset where the true effect is 1.5 by construction: the naive comparison returns 2.07, holding the confounder constant returns 1.47, and the specification that adds a collider moves the estimate away from the truth. More control, worse answer.

8:40 · 23 slides · printable slides · transcript

Slides

Printable deck →

Closing backdoor paths

1 / 23
Transcript23 sections

Generated from the narration script. Plain text version.

1There are various statistical techniques to cut the bad paths so they don't bias our causal effect of interest. I'll show you regression, and there are other examples in the reading.

2For this example, I simulated a dataset on one thousand people who decided to take the road less traveled or the road more traveled. This is an observational dataset. There was no random assignment to road traveled. I didn't simulate social relationships, because we don't need it to estimate the total effect of road traveled on happiness. That leaves four core variables.

3Cognition is the confounding variable. It's binary, set to one if the person scored high on a measure of optimism, otherwise zero. Imagine that everyone completed a questionnaire before they decided on a road, and we used their answers to construct an indicator of high or low optimism. Road traveled is the exposure. It's also binary, set to one if the person chose the road less traveled. This variable was simulated to be a function of cognition. In this dataset, the odds of taking the road less traveled are eighteen times higher for high optimism folks.

4Happiness is the outcome. It can range from zero to ten, where ten represents greatest happiness. Imagine that data on happiness was collected ten years after people selected and traveled down one of the roads. It was simulated to be a function of cognition and of road traveled. On average, high optimism folks scored one point higher on the measure of happiness. And active is the collider. It's binary, set to one if the person has an active lifestyle, collected sometime after the person traveled the road. It was simulated to be a function of road traveled and happiness. Active does not cause anything in the model.

5I simulated the data so that the road less traveled increases happiness by one point five points. That will be the correct answer going forward.

6This should remind you that our core problem in this DAG is that the exposure, road traveled, and the outcome, happiness, share a common cause: cognition. Which is to say that cognition confounds the relationship between X and Y.

7You can see this in the data. In the left panel, people who scored high on optimism are represented in red, and low optimism in black. Notice that red appears more frequently among the road less traveled group, and red also looks to be associated with higher happiness scores. If we just compare happiness scores by road traveled, we get the wrong answer: a difference of two point zero seven. That's because cognition biases the X Y relationship.

8To get to the right answer, we need to hold cognition constant. In the right panel I show this by looking just at people with a low optimism score. Now if we compare happiness scores by road traveled, we get close to the correct answer: a difference of one point four seven. Simulations involve a bit of noise.

9In practice we might estimate the effect via a technique like multiple regression. Actually you'd probably use something like matching or inverse probability weighting, but those methods make the example too complex. I've also modified the variable names to make the figure easier to read. Most notably, the exposure road traveled is represented as x, and the outcome happiness is represented as y. Cognition and active are simply c and a.

10Here are three models. The first, y on x, is a naive regression of happiness on road traveled. The second, y on x plus c, is the same, but also controlling for cognition. And the third, y on x plus c plus a, is the same again, but also controlling for active.

11Here are the results of all three, each with a ninety-five percent confidence interval. The vertical line is the simulated effect, one point five. One model sits on that line. The other two do not.

12The red model, y on x, repeats the same mistake we made a moment ago. It just estimates the impact of road traveled on happiness without accounting for the confounding role of cognition. It returns the wrong answer, out at about two point zero seven.

13The green model, y on x plus c, controls for cognition, thereby removing the parts of x and y that are explained by cognition. This closes the biasing pathway and returns the correct answer, right on the simulated effect of one point five.

14The blue model, y on x plus c plus a, gets us into trouble. In the data I simulated, active is a collider. It doesn't cause anything in the DAG, and the bad path it sits on is closed by default. When I control for it by adding it to the regression, I open the pathway and distort the relationship between x and y. The estimate lands near one point zero, further from the truth than the model with fewer covariates.

15It might come as a surprise that something can go wrong by adding covariates to your model. Many of us are taught that it's probably good, or at least neutral, to add all seemingly relevant variables to a regression. This is just bad advice. Some covariates will make your estimates worse, not better.

16There is a term for this: causal salad. It describes the very common practice of tossing lots of control variables into a statistical model and telling a causal story. This approach can work when the goal is prediction, but it can go very, very wrong when the goal is causal inference. One of the core points of Statistical Rethinking is that causal inference requires causal models that are separate from statistical models. Statistics alone can get us to the wrong answers. But if we follow the DAG, our causal model, we know to leave active alone.

17DAGs are useful tools for causal inference, but they are not magic. If your DAG does not completely and correctly identify your causal effect of interest, your estimates will be biased. To make matters worse, there is no test that will tell you if your DAG is correct. But there are tests that can tell you if it's wrong.

18Here's what I mean. Every DAG implies that certain variables should be conditionally independent of each other. If your data violate these implied independencies, something is wrong with your DAG. You can also run placebo tests, checking whether your approach produces null effects in situations where you'd expect no effect. These tests can falsify your DAG, but passing them doesn't prove it's correct. Your DAG could still be missing important variables or relationships that happen not to show up in these particular tests.

19But let's be clear: there is no approach to causal inference that sidesteps the need for unverifiable assumptions. DAGs require you to make and defend your assumptions, but so does every other approach. You just might not know it.

20So let me name the assumptions quickly. The first is the big one: we've accounted for all the confounders that matter. When we use confounder-control, we're betting that we've identified and adjusted for every variable that affects both treatment and outcome. Researchers call it different things by discipline. Ignorability in statistics, exogeneity in economics, exchangeability in epidemiology. The names differ, but they all mean roughly the same thing: after we adjust for our covariates, the only remaining difference between the groups is the treatment itself. If we missed something important, our estimate is biased. Randomization solves this problem entirely, because it breaks the link between who someone is and what treatment they receive. But for observational studies, we always have to worry: what if there's an important confounder we didn't measure?

21The second is positivity: everyone has some chance of being treated. If you're adjusting for certain variables, every combination of those variables needs to include some treated and some untreated people. Suppose you're studying the effects of hysterectomy and you adjust for biological sex. Only people with a uterus can have a hysterectomy, so there are no treated males in your data. You're asking what would happen if a male had a hysterectomy, and your data can't answer that. The fix is simple. Don't adjust for sex in this case.

22The third and fourth assumptions are in the chapter, and they are better read there than listed here. Consistency asks whether the treatment is really one thing or many things lumped together, like text message reminders that arrive in the morning versus at night. And the fourth is measurement: all causal inference assumes that our measures of treatment, outcome, and confounders actually capture what we intend. That one is important enough that the book devotes an entire chapter to it.

23Back at the start of this chapter I listed three requirements for identifying causal relationships. Causes must come before effects. Causes and effects are associated, meaning they go together or covary. And there are no other plausible alternative explanations for the effect other than the proposed cause. That third requirement is the hardest of them all to meet, and most of the assumptions it rests on can't be directly tested.

Regression AdjustmentConfoundingCollider BiasCausal Assumptions