Skip to content

Commit 25f5572

Browse files
Merge pull request #2 from malcolmbarrett/update_slides
Bump countdown, re-knit slides, add stretch goal
2 parents 8d8b351 + b021def commit 25f5572

File tree

20 files changed

+157
-80
lines changed

20 files changed

+157
-80
lines changed

exercises/06-outcome-model-exercises.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ boot_estimate <- ____(____, ____) %>%
5050
filter(term == ____)
5151
```
5252

53+
54+
Stretch goal: Do the same for a model using matching.

slides/00-intro.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class: center, middle, inverse, title-slide
1313

1414
# Causal Inference in R: Introduction
15-
### 2020-07-29 (updated: 2020-07-28)
15+
### 2020-07-29 (updated: 2020-11-18)
1616

1717
---
1818

slides/01-causal_modeling_whole_game.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class: center, middle, inverse, title-slide
1313

1414
# Causal Modeling in R: Whole Game
15-
### 2020-07-29 (updated: 2020-07-28)
15+
### 2020-07-29 (updated: 2020-11-18)
1616

1717
---
1818

117 KB
Loading

slides/02-dags.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ dagify(
191191
### 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).
192192
### Plot the DAG using `ggdag()`
193193

194-
`r countdown::countdown(minutes = 3)`
194+
`r countdown::countdown(minutes = 5)`
195195

196196
---
197197

@@ -298,7 +298,7 @@ smk_wt_dag %>%
298298
### 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?
299299
### 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.
300300

301-
`r countdown::countdown(minutes = 3)`
301+
`r countdown::countdown(minutes = 5)`
302302

303303
---
304304

@@ -362,7 +362,7 @@ ggdag_adjustment_set(smk_wt_dag)
362362
#### Use `ggdag_adjustment_set()` to visualize the adjustment sets. Add the arguments `use_labels = "label"` and `text = FALSE`.
363363
#### Write an R formula for each adjustment set, as you might if you were fitting a model in `lm()` or `glm()`
364364

365-
`r countdown::countdown(minutes = 3)`
365+
`r countdown::countdown(minutes = 5)`
366366

367367
---
368368

slides/02-dags.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class: center, middle, inverse, title-slide
1515

1616
# Causal Diagrams in R
17-
### 2020-07-29 (updated: 2020-07-28)
17+
### 2020-07-29 (updated: 2020-11-18)
1818

1919
---
2020

@@ -144,8 +144,8 @@
144144
### 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).
145145
### Plot the DAG using `ggdag()`
146146

147-
<div class="countdown" id="timer_5f20b9d1" style="right:0;bottom:0;" data-warnwhen="0">
148-
<code class="countdown-time"><span class="countdown-digits minutes">03</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
147+
<div class="countdown" id="timer_5fb59e40" style="right:0;bottom:0;" data-warnwhen="0">
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>
149149
</div>
150150

151151
---
@@ -225,8 +225,8 @@
225225
### 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?
226226
### 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.
227227

228-
<div class="countdown" id="timer_5f20bc6a" style="right:0;bottom:0;" data-warnwhen="0">
229-
<code class="countdown-time"><span class="countdown-digits minutes">03</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
228+
<div class="countdown" id="timer_5fb59e7d" style="right:0;bottom:0;" data-warnwhen="0">
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>
230230
</div>
231231

232232
---
@@ -312,8 +312,8 @@
312312
#### Use `ggdag_adjustment_set()` to visualize the adjustment sets. Add the arguments `use_labels = "label"` and `text = FALSE`.
313313
#### Write an R formula for each adjustment set, as you might if you were fitting a model in `lm()` or `glm()`
314314

315-
<div class="countdown" id="timer_5f20bae1" style="right:0;bottom:0;" data-warnwhen="0">
316-
<code class="countdown-time"><span class="countdown-digits minutes">03</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
315+
<div class="countdown" id="timer_5fb59da2" style="right:0;bottom:0;" data-warnwhen="0">
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>
317317
</div>
318318

319319
---
131 KB
Loading

slides/03-pscores.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class: inverse
193193

194194
## Your turn
195195

196-
`r countdown::countdown(minutes = 5)`
196+
`r countdown::countdown(minutes = 7)`
197197

198198
1. Using the **confounders** identified in the previous DAG, fit a propensity score model for `qsmk`
199199
2. Stretch: Create two histograms, one of the propensity scores for those that quit smoking and one for those that do not

slides/03-pscores.html

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<!DOCTYPE html>
2-
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
2+
<html lang="" xml:lang="">
33
<head>
44
<title>Propensity Scores</title>
55
<meta charset="utf-8" />
66
<meta name="author" content="Lucy D’Agostino McGowan" />
7+
<script src="libs/header-attrs-2.5/header-attrs.js"></script>
78
<link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
89
<link href="libs/countdown-0.3.5/countdown.css" rel="stylesheet" />
910
<script src="libs/countdown-0.3.5/countdown.js"></script>
@@ -16,7 +17,7 @@
1617
# Propensity Scores
1718
### Lucy D’Agostino McGowan
1819
### Wake Forest University
19-
### 2020-07-29 (updated: 2020-07-29)
20+
### 2020-07-29 (updated: 2020-11-18)
2021

2122
---
2223

@@ -167,8 +168,8 @@
167168

168169
## Your turn
169170

170-
<div class="countdown" id="timer_5f218f59" style="right:0;bottom:0;" data-warnwhen="0">
171-
<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>
171+
<div class="countdown" id="timer_5fb59d1d" style="right:0;bottom:0;" data-warnwhen="0">
172+
<code class="countdown-time"><span class="countdown-digits minutes">07</span><span class="countdown-digits colon">:</span><span class="countdown-digits seconds">00</span></code>
172173
</div>
173174

174175
1. Using the **confounders** identified in the previous DAG, fit a propensity score model for `qsmk`
@@ -224,6 +225,32 @@
224225
deleted = true;
225226
});
226227
})();
228+
(function() {
229+
"use strict"
230+
// Replace <script> tags in slides area to make them executable
231+
var scripts = document.querySelectorAll(
232+
'.remark-slides-area .remark-slide-container script'
233+
);
234+
if (!scripts.length) return;
235+
for (var i = 0; i < scripts.length; i++) {
236+
var s = document.createElement('script');
237+
var code = document.createTextNode(scripts[i].textContent);
238+
s.appendChild(code);
239+
var scriptAttrs = scripts[i].attributes;
240+
for (var j = 0; j < scriptAttrs.length; j++) {
241+
s.setAttribute(scriptAttrs[j].name, scriptAttrs[j].value);
242+
}
243+
scripts[i].parentElement.replaceChild(s, scripts[i]);
244+
}
245+
})();
246+
(function() {
247+
var links = document.getElementsByTagName('a');
248+
for (var i = 0; i < links.length; i++) {
249+
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
250+
links[i].target = '_blank';
251+
}
252+
}
253+
})();
227254
// adds .remark-code-has-line-highlighted class to <pre> parent elements
228255
// of code chunks containing highlighted lines with class .remark-code-line-highlighted
229256
(function(d) {
@@ -242,17 +269,6 @@
242269
preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
243270
})(document);</script>
244271

245-
<script>
246-
(function() {
247-
var links = document.getElementsByTagName('a');
248-
for (var i = 0; i < links.length; i++) {
249-
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
250-
links[i].target = '_blank';
251-
}
252-
}
253-
})();
254-
</script>
255-
256272
<script>
257273
slideshow._releaseMath = function(el) {
258274
var i, text, code, codes = el.getElementsByTagName('code');

slides/04-pscore-weighting.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class: inverse
238238

239239
## Your Turn
240240

241-
`r countdown::countdown(minutes = 5)`
241+
`r countdown::countdown(minutes = 7)`
242242

243243
1. Using the propensity scores you created in the previous exercise, add the ATE weights to your data frame `df`
244244

0 commit comments

Comments
 (0)