Skip to content

Commit 6322189

Browse files
Merge pull request #52 from r-causal/add_hex_stickers
2 parents 8253c60 + 446ba74 commit 6322189

File tree

12 files changed

+179
-122
lines changed

12 files changed

+179
-122
lines changed

slides/raw/04-dags.html

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,12 @@ <h2>The basic idea</h2>
418418
<li class="fragment">Write causal pathways as arrows (edges)</li>
419419
</ol>
420420
</section>
421-
<section id="section-1" class="slide level2 center huge" data-background-color="#23373B">
422-
<h2></h2>
423-
<h3 id="ggdag"><strong>ggdag</strong></h3>
421+
<section id="section-1" class="slide level2">
422+
<h2><img data-src="img/hex/ggdag.png" class="absolute" style="top: 0px; right: 0px; width: 140px; "></h2>
424423
</section>
425-
<section class="slide level2">
426-
424+
<section id="section-2" class="slide level2">
425+
<h2><img data-src="img/hex/ggdag.png" class="absolute" style="top: 0px; right: 0px; width: 140px; "></h2>
426+
<p><br></p>
427427
<div class="cell" data-layout-align="center">
428428
<div class="cell-output-display">
429429
<div class="quarto-figure quarto-figure-center">
@@ -434,8 +434,9 @@ <h3 id="ggdag"><strong>ggdag</strong></h3>
434434
</div>
435435
</div>
436436
</section>
437-
<section class="slide level2">
438-
437+
<section id="section-3" class="slide level2">
438+
<h2><img data-src="img/hex/ggdag.png" class="absolute" style="top: 0px; right: 0px; width: 140px; "></h2>
439+
<p><br></p>
439440
<div class="cell" data-layout-align="center">
440441
<div class="cell-output-display">
441442
<div class="quarto-figure quarto-figure-center">
@@ -446,8 +447,9 @@ <h3 id="ggdag"><strong>ggdag</strong></h3>
446447
</div>
447448
</div>
448449
</section>
449-
<section class="slide level2">
450-
450+
<section id="section-4" class="slide level2">
451+
<h2><img data-src="img/hex/ggdag.png" class="absolute" style="top: 0px; right: 0px; width: 140px; "></h2>
452+
<p><br></p>
451453
<div class="cell" data-layout-align="center">
452454
<div class="cell-output-display">
453455
<div class="quarto-figure quarto-figure-center">
@@ -458,8 +460,9 @@ <h3 id="ggdag"><strong>ggdag</strong></h3>
458460
</div>
459461
</div>
460462
</section>
461-
<section class="slide level2">
462-
463+
<section id="section-5" class="slide level2">
464+
<h2><img data-src="img/hex/ggdag.png" class="absolute" style="top: 0px; right: 0px; width: 140px; "></h2>
465+
<p><br></p>
463466
<div class="cell" data-layout-align="center">
464467
<div class="cell-output-display">
465468
<div class="quarto-figure quarto-figure-center">
@@ -523,7 +526,7 @@ <h2><em>Your Turn 1</em> (<strong><code>04-dags-exercises.qmd</code></strong>)</
523526
<h3 id="specify-a-dag-with-dagify.-write-your-assumption-that-smoking-causes-cancer-as-a-formula.">Specify a DAG with <code>dagify()</code>. Write your assumption that <code>smoking</code> causes <code>cancer</code> as a formula.</h3>
524527
<h3 id="were-going-to-assume-that-coffee-does-not-cause-cancer-so-theres-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.">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).</h3>
525528
<h3 id="plot-the-dag-using-ggdag">Plot the DAG using <code>ggdag()</code></h3>
526-
<p></p><div class="countdown" id="timer_48e176ed" data-update-every="1" tabindex="0" style="right:0;bottom:0;"> <div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div> <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> </div><p></p>
529+
<p></p><div class="countdown" id="timer_d21b2537" data-update-every="1" tabindex="0" style="right:0;bottom:0;"> <div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div> <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> </div><p></p>
527530
</section>
528531
<section id="your-turn-1-02-dags-exercises.qmd" class="slide level2">
529532
<h2><em>Your Turn 1</em> (<code>02-dags-exercises.qmd</code>)</h2>
@@ -579,7 +582,7 @@ <h2><code>ggdag_paths()</code></h2>
579582
<h2><em>Your Turn 2</em></h2>
580583
<h3 id="call-tidy_dagitty-on-coffee_cancer_dag-to-create-a-tidy-dag-then-pass-the-results-to-dag_paths.-whats-different-about-these-data">Call <code>tidy_dagitty()</code> on <code>coffee_cancer_dag</code> to create a tidy DAG, then pass the results to <code>dag_paths()</code>. What’s different about these data?</h3>
581584
<h3 id="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.">Plot the open paths with <code>ggdag_paths()</code>. (Just give it <code>coffee_cancer_dag</code> rather than using <code>dag_paths()</code>; the quick plot function will do that for you.) Remember, since we assume there is <em>no</em> causal path from coffee to lung cancer, any open paths must be confounding pathways.</h3>
582-
<p></p><div class="countdown" id="timer_831dae61" data-update-every="1" tabindex="0" style="right:0;bottom:0;"> <div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div> <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> </div><p></p>
585+
<p></p><div class="countdown" id="timer_766774e2" data-update-every="1" tabindex="0" style="right:0;bottom:0;"> <div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div> <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> </div><p></p>
583586
</section>
584587
<section id="your-turn-2-1" class="slide level2">
585588
<h2><em>Your Turn 2</em></h2>
@@ -681,7 +684,7 @@ <h2><em>Your Turn 3</em></h2>
681684
<h3 id="now-that-we-know-the-open-confounding-pathways-sometimes-called-backdoor-paths-we-need-to-know-how-to-close-them-first-well-ask-ggdag-for-adjustment-sets-then-we-would-need-to-do-something-in-our-analysis-to-account-for-at-least-one-adjustment-set-e.g.-multivariable-regression-weighting-or-matching-for-the-adjustment-sets.">Now that we know the open, confounding pathways (sometimes called “backdoor paths”), we need to know how to close them! First, we’ll ask {ggdag} for adjustment sets, then we would need to do something in our analysis to account for at least one adjustment set (e.g.&nbsp;multivariable regression, weighting, or matching for the adjustment sets).</h3>
682685
<h3 id="use-ggdag_adjustment_set-to-visualize-the-adjustment-sets.-add-the-arguments-use_labels-label-and-text-false.">Use <code>ggdag_adjustment_set()</code> to visualize the adjustment sets. Add the arguments <code>use_labels = "label"</code> and <code>text = FALSE</code>.</h3>
683686
<h3 id="write-an-r-formula-for-each-adjustment-set-as-you-might-if-you-were-fitting-a-model-in-lm-or-glm">Write an R formula for each adjustment set, as you might if you were fitting a model in <code>lm()</code> or <code>glm()</code></h3>
684-
<p></p><div class="countdown" id="timer_00419a1f" data-update-every="1" tabindex="0" style="right:0;bottom:0;"> <div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div> <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> </div><p></p>
687+
<p></p><div class="countdown" id="timer_1ea6f653" data-update-every="1" tabindex="0" style="right:0;bottom:0;"> <div class="countdown-controls"><button class="countdown-bump-down"></button><button class="countdown-bump-up">+</button></div> <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> </div><p></p>
685688
</section>
686689
<section id="your-turn-3-1" class="slide level2">
687690
<h2><em>Your Turn 3</em></h2>
@@ -777,7 +780,7 @@ <h2>Common trip ups</h2>
777780
<h2>Time-ordering</h2>
778781

779782
<img data-src="04-dags_files/figure-revealjs/unnamed-chunk-28-1.png" style="width:80.0%" class="r-stretch quarto-figure-center"></section>
780-
<section id="section-2" class="slide level2 large center middle" data-background-color="#23373B">
783+
<section id="section-6" class="slide level2 large center middle" data-background-color="#23373B">
781784
<h2></h2>
782785
<h3 id="dont-adjust-for-the-future"><strong>don’t adjust for the future!</strong></h3>
783786
</section>

slides/raw/04-dags.qmd

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ smk_wt_dag <- dagify(
7474
1. Write variables as nodes
7575
1. Write causal pathways as arrows (edges)
7676

77-
## {background-color="#23373B" .center .huge}
77+
## ![](img/hex/ggdag.png){.absolute top=0 right=0 width=140}
7878

79-
### **ggdag**
79+
## ![](img/hex/ggdag.png){.absolute top=0 right=0 width=140}
80+
81+
<br />
8082

81-
---
8283

8384
```{r}
8485
#| echo: false
@@ -87,7 +88,9 @@ smk_wt_dag <- dagify(
8788
knitr::include_graphics("img/ggdagitty.png")
8889
```
8990

90-
---
91+
## ![](img/hex/ggdag.png){.absolute top=0 right=0 width=140}
92+
93+
<br />
9194

9295
```{r}
9396
#| echo: false
@@ -96,7 +99,10 @@ knitr::include_graphics("img/ggdagitty.png")
9699
knitr::include_graphics("img/ggdagitty_alg.png")
97100
```
98101

99-
---
102+
103+
## ![](img/hex/ggdag.png){.absolute top=0 right=0 width=140}
104+
105+
<br />
100106

101107
```{r}
102108
#| echo: false
@@ -105,7 +111,11 @@ knitr::include_graphics("img/ggdagitty_alg.png")
105111
knitr::include_graphics("img/ggdagitty_plots.png")
106112
```
107113

108-
---
114+
115+
## ![](img/hex/ggdag.png){.absolute top=0 right=0 width=140}
116+
117+
<br />
118+
109119

110120
```{r}
111121
#| echo: false
@@ -114,7 +124,7 @@ knitr::include_graphics("img/ggdagitty_plots.png")
114124
knitr::include_graphics("img/tidy_ggdagitty.png")
115125
```
116126

117-
## Step 1: Specify your DAG
127+
## Step 1: Specify your DAG
118128

119129
. . .
120130

0 commit comments

Comments
 (0)