Slide 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.
A simulated dataset of 1,000 travelers
Observational — there was no random assignment to `road_traveled`
`social_relationships` is left out; the total effect doesn't need it
Slide 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.
The confounder and the exposure
`cognition`
Binary: 1 if high on optimism
From a questionnaire, before the road
`road_traveled`
Binary: 1 if the road less traveled
Simulated as a function of `cognition`
Odds 18× higher for high optimism
Slide 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.
The outcome and the collider
`happiness`
Ranges 0 to 10, collected 10 years later
A function of `cognition` and the road
High optimism scored 1 point higher
`active`
Binary: 1 if an active lifestyle
Collected after the road was traveled
Causes nothing in the model
Slide 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.
The road less traveled increases happiness by 1.5 points
That is how the data were simulated
So 1.5 is the correct answer for everything that follows
Slide 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.
The exposure and the outcome share a common cause
Cognition confounds the relationship between road traveled and happiness. Reproduced from Chapter 7.
Slide 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.
Compare happiness by road and the answer is 2.07
Left panel: high optimism in red. Red appears more often among the road less traveled, and red is associated with higher happiness. Reproduced from Chapter 7.
Slide 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.
Hold cognition constant and the answer is 1.47
Right panel: only the low optimism group. The comparison now lands close to the correct answer of 1.5. Simulations involve a bit of noise. Reproduced from Chapter 7.
Slide 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.
In practice we would estimate this with regression
Exposure `road_traveled` becomes `x`; outcome `happiness` becomes `y`
`cognition` becomes `c`, and `active` becomes `a`
In reality you'd probably reach for matching or weighting
Slide 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.
`y ~ x` — naive regression of happiness on road traveled
`y ~ x + c` — same, also controlling for cognition
`y ~ x + c + a` — same, also controlling for active
Slide 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.
Not all covariates are helpful
Estimated average treatment effects and 95% confidence intervals from the three models, against the simulated effect of 1.5. Reproduced from Chapter 7.
Slide 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.
`y ~ x` repeats the same mistake
It estimates the effect of `x` on `y` with no account of `c`
It returns the wrong answer
Slide 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.
Heiss, 2020
`y ~ x + c` closes the biasing pathway
Controlling for `c` removes the parts of `x` and `y` that `c` explains
It returns the correct answer
Slide 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.
`y ~ x + c + a` gets us into trouble
`a` is a collider — it causes nothing in the DAG
The bad path it sits on is closed by default
Controlling for it opens the path and distorts `x` and `y`
Slide 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.
Adding a covariate can make an estimate worse
Many of us are taught it is good, or at least neutral, to add every relevant variable
Some covariates will make your estimates worse, not better
Slide 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.
McElreath, 2020
Causal salad
Tossing control variables into a model and telling a causal story
It can work for prediction, and go very wrong for causal inference
Causal inference requires causal models separate from statistical models
Slide 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.
DAGs are useful tools, and they are not magic
An incomplete or incorrect DAG gives you a biased estimate
There is no test that will tell you your DAG is correct
There are tests that can tell you it is wrong
Slide 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.
Tests can falsify a DAG; passing them proves nothing
Every DAG implies certain variables are conditionally independent
Violated implied independencies mean something is wrong
Placebo tests check for null effects where you expect none
Slide 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.
McElreath, 2020
No approach sidesteps unverifiable assumptions
DAGs require you to make and defend your assumptions
So does every other approach — you just might not know it
Slide 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.
Gelman et al., 2020 · Assumption 1 of 4
We've accounted for all the confounders that matter
*Ignorability in statistics, exogeneity in economics, exchangeability* in epidemiology
After adjustment, the only remaining difference between groups is the treatment
Miss something important and the estimate is biased
Slide 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?
Westreich et al., 2019 · Assumption 2 of 4
Everyone has some chance of being treated
Called *positivity*: every combination of adjustment variables needs treated and untreated people
Study hysterectomy, adjust for sex, and there are no treated males in the data
The fix is simple: don't adjust for sex in this case
Slide 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.
Assumptions 3 and 4 of 4
Two more, and both are in the chapter
Consistency
Is "the treatment" one thing or many?
Morning texts and night texts
Be precise about what you estimate
Measurement
Measures capture what we intend
Misclassification biases the estimate
Chapter 9 is devoted to it
Slide 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.
In Closing
The third requirement is the hardest of them all to meet
Causes come before effects; causes and effects covary
And there are no other plausible alternative explanations
Most of the assumptions that requirement rests on cannot be directly tested
Slide 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.