Confounders & Causal Diagrams

P8.causal-methods.01 · Audience: guest, it-ml, language-pro · Prerequisites: Why Randomize?

The experimentation track earned its causal claims the clean way: randomize, and the treated and control groups differ by nothing but the treatment. This module is about the harder world where you cannot randomize — you have only observational data — and correlation is no longer allowed to speak for causation. The tool that keeps you honest is a picture: a causal diagram, a handful of arrows drawn with discipline, that tells you exactly which variables you must adjust for and — the part everyone gets wrong — which ones you must never touch.

Step 1 / 5Arrows with discipline

A causal diagram (a DAG — directed acyclic graph) is the simplest honest way to write down what you believe causes what. Each variable is a node; each arrow A → B is a claim that A directly causes B. Two rules give the picture its discipline: arrows have a direction (causation runs one way, unlike a correlation, which is symmetric), and the graph is acyclic — you can never follow arrows and return to where you started, because nothing causes itself.

That is the whole vocabulary. The power is that once the arrows are on paper, the question "which variables must I adjust for to read the causal effect of treatment on outcome?" stops being a matter of taste and becomes something you can compute from the graph.

ⓘ Concept: Causal diagram (DAG)
nodes=variables;arrowAB=AisadirectcauseofB;nodirectedcyclesnodes = variables; arrow A → B = A is a direct cause of B; no directed cycles

Why it matters — A DAG turns vague worries — 'but maybe sicker patients got the drug more' — into an explicit, checkable claim. Every arrow you draw is a hypothesis you can defend or drop; every arrow you omit is an assumption of no direct effect. The diagram is the contract that decides which adjustments are legitimate.

🗣️ From a linguist's perspective: The arrow as a case marker
In a language with grammatical case, the ending on a noun tells you who did what to whom — nominative acts, accusative is acted upon — so the dog bit the man and the man bit the dog are told apart by morphology, not word order. A DAG arrow is that case marking made visual: it fixes agent and patient, subject and object, cause and effect. A plain correlation is a caseless language where dog and man merely co-occur and you cannot tell who bit whom.
Ask the mentor about this module

Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.

Ctrl/Cmd + Enter to send

Try it yourself

A scratch console for this page's ideas — ungraded, nothing you run here is recorded.

Scratch console

A scratch console with the scientific stack (pandas, numpy, scikit-learn). Runs on the server — no network, resource-limited and measured.

Output appears here.