NeuroNomixer logoNeuroNomixer
  • Home
  • Blog
  • Visual Guides
  • Authors
  • Contact
Sign InSign Up
NeuroNomixer logo
HomeBlogAuthorsContactPrivacy Policy

© 2026 NeuroNomixer — Built with Next.js & Tailwind CSS

Visual Guides/Causal Thinking: Confounders, Mediators & DAGs
Unit 12: Experimental Design

Causal Thinking: Confounders, Mediators & DAGs

Correlation isn't causation, but how do you figure out what actually causes what? Directed Acyclic Graphs (DAGs) give you a rigorous visual language for causal reasoning. Explore the three fundamental variable types and see how controlling the wrong variable can introduce bias instead of removing it.

Confounders
Mediators
Colliders

Sign in to track progress

From Correlation to Causation

What is a DAG?

A Directed Acyclic Graph (DAG) is a causal diagram where nodes represent variables and directed edges (arrows) represent causal relationships. 'Acyclic' means no variable can cause itself: no feedback loops.

Why DAGs Matter

DAGs make your causal assumptions explicit and testable. They tell you exactly which variables to control for (and which to avoid) to get an unbiased estimate of a causal effect.

The Causal Hierarchy

Judea Pearl's causal hierarchy: (1) Association: seeing patterns in data; (2) Intervention: predicting what happens if you change a variable; (3) Counterfactuals: reasoning about 'what would have happened'. A causal DAG plus the right adjustments lets you answer level-2 questions from observational data; level 3 needs stronger assumptions (structural equations).

d-separation

Two variables are d-separated by a conditioning set Z if every path between them is blocked. A chain or fork node (like a confounder) blocks its path when it IS in Z; a collider blocks its path when neither it nor any of its descendants is in Z. d-separation implies conditional independence in every distribution compatible with the DAG.

⊗

The Back-Door Criterion

To estimate the causal effect of X → Y, you need to block all back-door paths: paths that go from X to Y via arrows entering X. A valid adjustment set Z satisfies:

Rule 1Z blocks all back-door paths from X to Y
Rule 2Z contains no descendant of X (no mediators or colliders on the causal path)

Interactive Scenarios

A hidden variable that causes both treatment and outcome: the most common source of spurious correlation.

ConfounderConfounding variable

The Ice Cream & Drowning Mystery

spurious association (not causal)SummerIceCreamSalesDrowningDeaths
SummerConfounder: causes both treatment and outcome
Ice Cream SalesTreatment: the variable we (naively) study
Drowning DeathsOutcome: what we are trying to explain
💡

Try checking "Summer": the dashed spurious association between Ice Cream and Drowning disappears from the graph.

Control for variable

✗Biased: spurious positive correlation
biased

Ice cream sales and drowning deaths look positively correlated, but only because Summer drives both. This is the classic confounder pattern.

The back-door path Ice Cream ← Summer → Drowning is open. You must control for Summer (or any sufficient adjustment set blocking this path) to get the true causal effect.

Controlled for:nothing

Common Causal Mistakes

⊘

Over-adjusting

Adding too many controls can block causal paths or open collider paths, introducing bias instead of removing it.

Fix:Use a DAG to identify the minimal sufficient adjustment set.
→M→

Adjusting for mediators

Controlling for a mediator blocks the indirect causal effect. Your estimate becomes "direct effect only", which is valid only if that's your goal.

Fix:Explicitly decide: do you want total effect or direct effect?
✕

Collider conditioning

Selecting on a collider (e.g., studying only successful people) creates spurious correlations between its causes, even if they are truly independent.

Fix:Never condition on a collider unless you use bias-correction methods.

Key Takeaways

  • 1.A confounder causes both treatment and outcome; it must be controlled to remove spurious correlations.
  • 2.A mediator lies on the causal path; controlling it gives you the direct effect only (and blocks the indirect effect).
  • 3.A collider is caused by two variables; conditioning on it OPENS a spurious path between its causes.
  • 4.Draw the DAG before choosing your adjustment set. Use the back-door criterion to find the minimal sufficient set.
  • 5.Selection bias, publication bias, and survivor bias are all examples of collider conditioning in disguise.

Save your progress

Sign in to track which visual guides you've completed.

Sign in
← All GuidesNext Guide →