Skip to content

Commit 3a2126e

Browse files
authored
✨ add chapter 8 (#6)
1 parent 45ece66 commit 3a2126e

File tree

6 files changed

+97
-8
lines changed

6 files changed

+97
-8
lines changed

08_causal-paths-and-closing-back-doors.Rmd

Lines changed: 97 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,112 @@
22

33
**Learning objectives:**
44

5-
- THESE ARE NICE TO HAVE BUT NOT ABSOLUTELY NECESSARY
5+
- identify paths in DAGs
6+
- understand the difference between good and bad paths, and front-door vs. back-door paths
7+
- understand how to Close paths
8+
- find colliders
9+
- understand how to use paths to test your DAG
610

7-
## SLIDE 1 {-}
11+
## Paths
812

9-
- ADD SLIDES AS SECTIONS (`##`).
10-
- TRY TO KEEP THEM RELATIVELY SLIDE-LIKE; THESE ARE NOTES, NOT THE BOOK ITSELF.
13+
> A path between two variables on a causal diagram is a description of the set of arrows and nodes you visit when “walking” from one variable to another.
1114
12-
## Meeting Videos {-}
15+
- tell us how two variables are related
16+
- how are B and C related?
1317

14-
### Cohort 1 {-}
18+
![](images/ch8_closing-back-doors/causalpaths-example-1.png)
19+
20+
> The paths can tell us the road we want to walk on, and also the road we want to avoid.
21+
22+
## Finding all paths
23+
24+
1. Start at the treatment variable
25+
2. Follow one of the arrows coming in/out of the treatment variable to find another variable
26+
3. Follow one of the arrows coming in or out of *that* variable
27+
4. Keep repeating step 3 until you either come to a variable you’ve already visited (loop!), or find the outcome variable (path)
28+
5. Every time you find a path/loop, back up one and try a different arrow in/out until you’ve tried them all. Then, back up again and try all those arrows
29+
30+
Let's practice!
31+
32+
![](images/ch8_closing-back-doors/causalpaths-basiclook-1.png)
33+
34+
## Solution
35+
36+
![](images/ch8_closing-back-doors/solutions_1.png)
37+
38+
39+
## Let's try another one: Wine and Health
40+
41+
![](images/ch8_closing-back-doors/causalpaths-wine-1.png)
42+
43+
44+
## Solution
45+
46+
![](images/ch8_closing-back-doors/solutions_2.png)
47+
48+
## Path types
49+
50+
- good vs. bad
51+
- front door vs. back door
52+
- beware direct vs. indirect effects
53+
54+
> Good Paths are the reasons why the treatment and outcome variables are related that you think should “count” for your research question. Bad paths are the paths that shouldn’t count, in other words the alternate explanations.
55+
56+
> Paths where all the arrows face away from Treatment are also known as front door paths. The rest would then be “back door paths.”
57+
58+
## Closing paths
59+
60+
> A path is Open if all of the variables along that paths are allowed to vary.
61+
62+
So we close a patch by
63+
64+
- picking a specific data set (e.g., no drug users)
65+
- adding a variable on the path as control variable
66+
- matching
67+
68+
So if we want to get the effect of *Wine* on *Lifespan*, which variables do we have to control for?
69+
70+
![](images/ch8_closing-back-doors/causalpaths-wine-1.png)
71+
72+
## Colliders
73+
74+
> A variable is a collider on a particular path if, on that path, both arrows point at it.
75+
76+
- A path is closed by default if a collider sits on it
77+
- The path opens up if the collider is controlled for
78+
79+
> Because once you control for the collider, the two variables pointing to the collider become related.
80+
81+
We can avoid colliders by
82+
83+
- not controlling for them
84+
- not choosing a sample where the collider is automatically controlled for
85+
86+
## Using paths to test the DAG
87+
88+
1. List all of the paths between A and B.
89+
1. Consider only the open paths.
90+
1. Do what you need to do to make sure they’re all Closed.
91+
1. If A and B are still related to each other (placebo test), that means there must be some other path you didn’t account for.
92+
93+
Interpretation of placebo tests:
94+
95+
- We have a model, so not accounting for all effects is okay.
96+
- small but nonzero relationship: fine
97+
- enormous and super-strong relationship: 😱
98+
99+
## Meeting Videos {.unnumbered}
100+
101+
### Cohort 1 {.unnumbered}
15102

16103
`r knitr::include_url("https://www.youtube.com/embed/URL")`
17104

18105
<details>
19-
<summary> Meeting chat log </summary>
20106

21-
```
107+
<summary>Meeting chat log</summary>
108+
109+
```
22110
LOG
23111
```
112+
24113
</details>
Loading
Loading
Loading
23.4 KB
Loading
25.1 KB
Loading

0 commit comments

Comments
 (0)