This lesson on Causal Inference Primer — Beyond Correlation is hands-on and example-driven. You will be able to distinguish between the three levels of causal inference, moving beyond simple correlation to understand intervention and counterfactual reasoning. You will learn that effective causal modeling requires explicitly stating assumptions about the underlying data generating process, often using tools like Directed Acyclic Graphs (DAGs).
What You'll Be Able To Do
- Differentiate the three rungs of Judea Pearl's ladder of causation.
- Explain why causal inference requires modeling the data generating process, not just the data.
- Formulate an intervention question suitable for the second rung of causation.
- Identify the additional conditioning required for a level three counterfactual question.
- Specify the role of a Directed Acyclic Graph (DAG) in defining causal assumptions.
Topics Covered in Causal Inference Primer — Beyond Correlation
- Ladder Introduction (0:00 - 0:30) — The discussion begins with a question about Judea Pearl's ladder of causation: association, intervention, and counterfactual.
- Causal Modeling Difficulty (0:30 - 1:15) — A common confusion is noted: effective causal modeling seems to require prior knowledge of the expected outcome.
- Process vs. Data (1:15 - 2:45) — Causality asks you to model the data generating process and state assumptions, rather than just manipulating the data itself.
- Rung 1: Association (2:45 - 3:15) — Level one is defined as plain old vanilla statistics and correlation.
- Rung 2: Intervention (3:15 - 3:45) — Level two involves asking 'what if' questions, such as emulating an experiment to determine causal effect.
- Rung 3: Counterfactual (3:45 - 5:00) — Level three questions imagine what might have been different, conditioning on observed facts that contradict the hypothetical.
- Defining Counterfactual (5:00 - 5:45) — A counterfactual is defined by the conflict between the hypothetical condition or outcome and the data actually observed.
- Role of DAGs (5:45 - 6:30) — Answering causal questions requires additional causal assumptions, which can often be specified using a Directed Acyclic Graph (DAG).
- Beyond DAGs (6:30 - 7:00) — More complex questions require assumptions beyond DAGs, such as assuming monotonicity in the relationship between variables.
SQL Cheat Sheet
-
Association (Rung 1)— Plain old statistics and correlation landSELECT CORR(A, B) FROM data; -
Intervention (Rung 2)— Asking 'what if' questions about potential actionsSELECT outcome FROM experiment WHERE action = 'vaccinate'; -
Counterfactual (Rung 3)— Imagining what might have been different given observed factsSELECT outcome FROM observed_data WHERE NOT action AND outcome; -
Data Generating Process— The underlying mechanism creating the observed data -
Causal Assumptions— Explicit statements required to move up the hierarchySELECT * FROM assumptions_table WHERE level = 3; -
DAG (Directed Acyclic Graph)— Visual tool to specify some causal assumptionsSELECT * FROM graph_nodes WHERE type = 'cause';
Comparison Table
| Level | Question Type | Required Assumptions |
|---|---|---|
| Level 1 (Association) | What is the correlation? | Vanilla statistics |
| Level 2 (Intervention) | What if I do X? | Causal effect assumptions |
| Level 3 (Counterfactual) | Would Y have happened? | Conditioning on observed facts |
Common Pitfalls
- Mistake: Treating correlation (Rung 1) as proof of causation (Rung 2). Avoid: Explicitly state assumptions about the data generating process before modeling.
- Mistake: Confusing an intervention question with a counterfactual question. Avoid: Rung 3 questions condition on observed facts that conflict with the hypothetical.
- Mistake: Focusing only on manipulating the data itself (transforms). Avoid: Causal modeling requires stating assumptions about the underlying generating process.
- Mistake: Believing you must know the answer before running any analysis. Avoid: Causal modeling asks you to state assumptions, not know the final outcome.
FAQs
- What is the difference between Rung 2 (Intervention) and Rung 3 (Counterfactual)? Rung 3 is Rung 2 plus conditioning on observed facts that contradict the hypothetical action or outcome. It asks what might have been, given what is.
- Why is causal modeling harder in industry than in academia? In industry, data scientists often have less control over how the data is collected. This makes it challenging to model the data generating process effectively.
- What makes a counterfactual question 'counterfactual'? The hypothetical condition (e.g., taking the vaccine) or the hypothetical outcome conflicts with data that was actually observed.
- Can a DAG specify all necessary causal assumptions? No. While DAGs specify structure, additional assumptions about mechanism, like monotonicity, are often required for complex questions.