|
14 | 14 | class: center, middle, inverse, title-slide
|
15 | 15 |
|
16 | 16 | # Causal Diagrams in R
|
17 |
| -### 2020-07-29 (updated: 2020-11-18) |
| 17 | +### 2020-07-29 (updated: 2020-12-01) |
18 | 18 |
|
19 | 19 | ---
|
20 | 20 |
|
|
144 | 144 | ### We're going to assume that coffee does not cause cancer, so there's no formula for that. But we still need to declare our causal question. Specify "coffee" as the exposure and "cancer" as the outcome (both in quotations marks).
|
145 | 145 | ### Plot the DAG using `ggdag()`
|
146 | 146 |
|
147 |
| -<div class="countdown" id="timer_5fb59e40" style="right:0;bottom:0;" data-warnwhen="0"> |
| 147 | +<div class="countdown" id="timer_5fc6bd20" style="right:0;bottom:0;" data-warnwhen="0"> |
148 | 148 | <code class="countdown-time"><span class="countdown-digits minutes">05</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
|
149 | 149 | </div>
|
150 | 150 |
|
|
225 | 225 | ### Call `tidy_dagitty()` on `coffee_cancer_dag` to create a tidy DAG, then pass the results to `dag_paths()`. What's different about these data?
|
226 | 226 | ### Plot the open paths with `ggdag_paths()`. (Just give it `coffee_cancer_dag` rather than using `dag_paths()`; the quick plot function will do that for you.) Remember, since we assume there is *no* causal path from coffee to lung cancer, any open paths must be confounding pathways.
|
227 | 227 |
|
228 |
| -<div class="countdown" id="timer_5fb59e7d" style="right:0;bottom:0;" data-warnwhen="0"> |
| 228 | +<div class="countdown" id="timer_5fc6be3a" style="right:0;bottom:0;" data-warnwhen="0"> |
229 | 229 | <code class="countdown-time"><span class="countdown-digits minutes">05</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
|
230 | 230 | </div>
|
231 | 231 |
|
|
312 | 312 | #### Use `ggdag_adjustment_set()` to visualize the adjustment sets. Add the arguments `use_labels = "label"` and `text = FALSE`.
|
313 | 313 | #### Write an R formula for each adjustment set, as you might if you were fitting a model in `lm()` or `glm()`
|
314 | 314 |
|
315 |
| -<div class="countdown" id="timer_5fb59da2" style="right:0;bottom:0;" data-warnwhen="0"> |
| 315 | +<div class="countdown" id="timer_5fc6be60" style="right:0;bottom:0;" data-warnwhen="0"> |
316 | 316 | <code class="countdown-time"><span class="countdown-digits minutes">05</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
|
317 | 317 | </div>
|
318 | 318 |
|
|
0 commit comments