3.2 — Causal Inference & DAGs — R Practice

Answers

Answers (html) Answers (Rmd)

For each of the following examples:

  1. Write out all of the causal pathways from X (treatment of interest) to Y (outcome of interest).
  2. Identify which variable(s) need to be controlled to estimate the causal effect of X on Y. You can use dagitty.net to help you, but you should start trying to recognize these on your own!
  3. Draw the DAGs in r using ggdag. After setting up the dag with dagify() (and specifying exposure and outcome inside dagify), pipe that into ggdag(). Try again piping it instead into ggdag_status() (to highlight what is X and what is Y). Try again piping it instead into ggdag_adjustment_set() to show what needs to be controlled.

Don’t forget to install ggdag!

Question 1

Question 2

Question 3

Question 4

Question 5

Previous
Next