diff --git a/slides/pdf/00-intro.pdf b/slides/pdf/00-intro.pdf index 9d9d2ad..1d9d66d 100644 Binary files a/slides/pdf/00-intro.pdf and b/slides/pdf/00-intro.pdf differ diff --git a/slides/pdf/01-causal_modeling_whole_game.pdf b/slides/pdf/01-causal_modeling_whole_game.pdf index 864cb33..224b53d 100644 Binary files a/slides/pdf/01-causal_modeling_whole_game.pdf and b/slides/pdf/01-causal_modeling_whole_game.pdf differ diff --git a/slides/pdf/02-when-standard-methods-succeed.pdf b/slides/pdf/02-when-standard-methods-succeed.pdf index c7180ea..9571666 100644 Binary files a/slides/pdf/02-when-standard-methods-succeed.pdf and b/slides/pdf/02-when-standard-methods-succeed.pdf differ diff --git a/slides/pdf/03-causal-inference-with-group-by-and-summarise.pdf b/slides/pdf/03-causal-inference-with-group-by-and-summarise.pdf index 3008047..6f42beb 100644 Binary files a/slides/pdf/03-causal-inference-with-group-by-and-summarise.pdf and b/slides/pdf/03-causal-inference-with-group-by-and-summarise.pdf differ diff --git a/slides/pdf/04-dags.pdf b/slides/pdf/04-dags.pdf index e3772e6..f0959a7 100644 Binary files a/slides/pdf/04-dags.pdf and b/slides/pdf/04-dags.pdf differ diff --git a/slides/pdf/05-quartets.pdf b/slides/pdf/05-quartets.pdf index d778c48..a736a37 100644 Binary files a/slides/pdf/05-quartets.pdf and b/slides/pdf/05-quartets.pdf differ diff --git a/slides/pdf/06-pscores.pdf b/slides/pdf/06-pscores.pdf index 585d580..b54defa 100644 Binary files a/slides/pdf/06-pscores.pdf and b/slides/pdf/06-pscores.pdf differ diff --git a/slides/pdf/07-using-pscores.pdf b/slides/pdf/07-using-pscores.pdf index a5fa10e..130bfdd 100644 Binary files a/slides/pdf/07-using-pscores.pdf and b/slides/pdf/07-using-pscores.pdf differ diff --git a/slides/pdf/08-pscore-diagnostics.pdf b/slides/pdf/08-pscore-diagnostics.pdf index cbed493..85d1749 100644 Binary files a/slides/pdf/08-pscore-diagnostics.pdf and b/slides/pdf/08-pscore-diagnostics.pdf differ diff --git a/slides/pdf/09-outcome-model.pdf b/slides/pdf/09-outcome-model.pdf index 0abb958..b466d22 100644 Binary files a/slides/pdf/09-outcome-model.pdf and b/slides/pdf/09-outcome-model.pdf differ diff --git a/slides/pdf/10-continuous-g-comp.pdf b/slides/pdf/10-continuous-g-comp.pdf index 5981abb..3c62988 100644 Binary files a/slides/pdf/10-continuous-g-comp.pdf and b/slides/pdf/10-continuous-g-comp.pdf differ diff --git a/slides/pdf/11-tipr.pdf b/slides/pdf/11-tipr.pdf index d195b4c..0aad84e 100644 Binary files a/slides/pdf/11-tipr.pdf and b/slides/pdf/11-tipr.pdf differ diff --git a/slides/pdf/12-whole_game-2.pdf b/slides/pdf/12-whole_game-2.pdf index 41530c1..46f08b5 100644 Binary files a/slides/pdf/12-whole_game-2.pdf and b/slides/pdf/12-whole_game-2.pdf differ diff --git a/slides/pdf/13-bonus-selection-bias.pdf b/slides/pdf/13-bonus-selection-bias.pdf index 81ad51c..b90d9ca 100644 Binary files a/slides/pdf/13-bonus-selection-bias.pdf and b/slides/pdf/13-bonus-selection-bias.pdf differ diff --git a/slides/pdf/14-bonus-continuous-pscores.pdf b/slides/pdf/14-bonus-continuous-pscores.pdf index 2066497..0ac7271 100644 Binary files a/slides/pdf/14-bonus-continuous-pscores.pdf and b/slides/pdf/14-bonus-continuous-pscores.pdf differ diff --git a/slides/raw/01-causal_modeling_whole_game.html b/slides/raw/01-causal_modeling_whole_game.html index 1ea76d4..42e476d 100644 --- a/slides/raw/01-causal_modeling_whole_game.html +++ b/slides/raw/01-causal_modeling_whole_game.html @@ -688,9 +688,9 @@
03-ci-with-group-by-and-summarise-exercises.qmd
)confounder
and exposure
outcome
for the groups03:00
03:00
02:00
02:00
ntile()
from dplyr to calculate a binned version of confounder
called confounder_q
. We’ll create a variable with 5 bins.03:00
03:00
04-dags-exercises.qmd
)
dagify()
. Write your assumption that smoking
causes cancer
as a formula.ggdag()
05:00
05:00
02-dags-exercises.qmd
)ggdag_paths()
tidy_dagitty()
on coffee_cancer_dag
to create a tidy DAG, then pass the results to dag_paths()
. What’s different about these data?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.05:00
05:00
ggdag_adjustment_set()
to visualize the adjustment sets. Add the arguments use_labels = "label"
and text = FALSE
.lm()
or glm()
05:00
05:00
2023-04-12 (updated: 2023-08-24)
+2023-04-12 (updated: 2023-08-31)
exposure
and the outcome
10:00
outcome_followup
and exposure_baseline
adjusting for covariate_baseline
: causal_collider_time
, causal_confounding_time
, causal_mediator_time
, causal_m_bias_time
10:00
10:00
10:00
extra_magic_morning
10:00
park_extra_magic_morning
10:00
10:00
10:00
10:00
10:00
weather_wdwhigh
confounder by whether or not the day had Extra Magic Hours.weather_wdwhigh
confounder10:00
park_temperature_high
confounder by whether or not the day had Extra Magic Hours.park_temperature_high
confounder# A tibble: 2 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
-1 (Intercept) 1.83 0.288 6.34 2.93e-10
-2 qsmk 3.44 0.407 8.44 7.05e-17
+1 (Intercept) 1.54 0.294 5.26 1.65e- 7
+2 qsmk 3.39 0.413 8.20 4.92e-16
12:00
ipw_fit
that fits the propensity score model and the weighted outcome model for the effect between extra_magic_morning
and avg_spostmin
12:00
ipw_fit
that fits the propensity score model and the weighted outcome model for the effect between park_extra_magic_morning
and wait_minutes_posted_avg
bootstraps()
and int_t()
functions to estimate the final effect.10-continuous-g-computation-exercises.qmd
10:00
10:00
2021-09-01 (updated: 2023-08-24)
+2021-09-01 (updated: 2023-08-31)
tip_coef()
effect_observed
: observed exposure - outcome effect 4.45 minutes (95% CI: 0.17, 8.37)effect_observed
: observed exposure - outcome effect 4.32 minutes (95% CI: 0.0009, 8.36)tip_coef()
confounder_outcome_effect
: relationship between the unmeasured confounder and outcometip_coef()
: specify one, it will estimate the otherexposure_confounder_effect
confounder_outcome_effect
Our causal effect estimate: 4.45 minutes (95% CI: 0.17, 8.37)
-# A tibble: 1 × 4
- effect_observed exposure_confounder_effect confounder_outcome_effect
- <dbl> <dbl> <dbl>
-1 0.17 0.1 1.7
-# ℹ 1 more variable: n_unmeasured_confounders <dbl>
-05:00
tip_coef()
function to conduct a sensitivity analysis for the estimate from your previous exercises.tip_coef()
function to conduct a sensitivity analysis for the estimate from your previous exercises. Use the lower bound of the confidence interval for the effect and 0.1
for the exposure-confounder effect.13-bonus-selection-bias.qmd
10:00
10:00
lm()
with avg_spostmin
as the outcome and the confounders identified in the DAG.lm()
with wait_minutes_posted_avg
as the outcome and the confounders identified in the DAG.augment()
to add model predictions to the data framewt_ate()
, calculate the weights using avg_postmin
, .fitted
, and .sigma
05:00
wt_ate()
, calculate the weights using wait_minutes_posted_avg
, .fitted
, and .sigma
05:00
03:00
03:00
wait_times_swts <- post_time_model |>
augment(data = wait_times) |>
mutate(swts = wt_ate(
- avg_spostmin,
+ wait_minutes_posted_avg,
.fitted,
.sigma = .sigma,
stabilize = TRUE
@@ -621,24 +621,24 @@ Fitting the outcome model
Your Turn 3
Estimate the relationship between posted wait times and actual wait times using the stabilized weights we just created.
- 03:00
+ 03:00
Your Turn 3
lm(
- avg_sactmin ~ avg_spostmin,
+ wait_minutes_actual_avg ~ wait_minutes_posted_avg,
weights = swts,
data = wait_times_swts
) |>
tidy() |>
- filter(term == "avg_spostmin") |>
+ filter(term == "wait_minutes_posted_avg") |>
mutate(estimate = estimate * 10)
# A tibble: 1 × 5
- term estimate std.error statistic p.value
- <chr> <dbl> <dbl> <dbl> <dbl>
-1 avg_spostmin -3.47 0.0836 -4.15 0.0000805
+ term estimate std.error statistic p.value
+ <chr> <dbl> <dbl> <dbl> <dbl>
+1 wait_minutes_posted_… 2.39 0.0659 3.63 4.93e-4