Causal Diagrams

What causes spurious correlations?

  1. Random chance
  2. Other factors (Confounders, Colliders, Mediators)

Causal diagrams

  • Visual depiction of causal relationships
  • Shows variables (nodes) and relationships (edges)
  • Time goes left to right
  • An arrow from one variable to another indicates a direct causal effect

DAGs

  • Directed
  • Acyclic
  • Graph

Does listening to a comedy podcast the morning before an exam improve graduate students test scores?

Step 1: Specify your DAG

podcast ~ mood + humor + prepared
exam ~ mood + prepared

Step 1: Specify your DAG

Causal effects & backdoor paths

Ok, correlation != causation. But why not?

We want to know if x -> y

But other paths also cause associations

Identify “backdoor” paths

Closing backdoor paths

We need to account for these open, non-causal paths

Randomization

Stratification, adjustment, weighting, matching, etc.

Identifying adjustment sets

Identifying adjustment sets

library(dagitty)
adjustmentSets(podcast_dag)
{ mood, prepared }

Choosing variables to include

Adjustment sets and domain knowledge

Conduct sensitivity analysis if you don’t have something important

Common trip ups

Using prediction metrics

Predictors of the outcome, predictors of the exposure

Forgetting to consider time-ordering (something has to happen before something else to cause it!)

Selection bias and colliders (more later!)

Incorrect functional form for confounders