Introduction to Directed Acyclic Graphs (DAGs)
What you'll learn: How DAGs visually map causal relationships to help you reason about confounders, colliders, and treatment effects.
What Are DAGs?
A Directed Acyclic Graph (DAG) is a visual diagram where:
- Nodes represent variables (like treatment, outcome, confounders)
- Directed edges (arrows) represent causal relationships pointing from cause to effect
- Acyclic means no variable can cause itself through any path (no loops)
Think of a DAG as a flowchart of cause-and-effect in your data-generating process.
Why DAGs Matter for Causal Inference
You've already encountered confounders, colliders, and instruments in earlier lessons. DAGs make these abstract concepts concrete:
- An arrow from X → Y means "X directly causes Y"
- A confounder appears as a node with arrows pointing to both treatment and outcome
- A collider has arrows pointing into it from multiple variables
- Paths show how effects flow and where bias can enter
DAGs help you decide what to control for (and what not to) when estimating causal effects from observational data.
A Simple Example
Imagine studying whether smoking causes lung cancer:
- Smoking → Lung Cancer (the causal path of interest)
- Genetics → Smoking and Genetics → Lung Cancer (genetics is a confounder)
The DAG reveals you must control for genetics, or your estimate will be biased by this backdoor path.
What Makes DAGs Powerful
Unlike correlation matrices or regression outputs, DAGs encode your assumptions about how the world works. They force you to explicitly state what causes what—making hidden biases visible and guiding your analytical strategy for identifying true causal effects.
Key Takeaway: DAGs are visual causal maps where nodes are variables and arrows show direct causal relationships, helping you identify which variables to control for when estimating causal effects from data.