Causal DAG Builder

Build a causal DAG, choose an exposure and outcome, inspect backdoor paths, and find every minimal sufficient adjustment set in your browser.

At a glance

Computes
Minimal sufficient adjustment sets, backdoor paths, and d-separation for a DAG you supply.
You supply
Variables, direct-cause arrows, one exposure, one outcome, an optional conditioning set.
Use when
You must decide which covariates to control for before fitting a model.
Not for
Estimating effects or testing the graph against data; this analyzes assumptions only. Linear Regression Calculator

Runs in your browser. Graph labels and model state are not uploaded.

Causal graph

Causal DAG for exposure X and outcome Y Three observed variables. Z points to X and Y. X points to Y. Adjust for Z. X Y Z

Z directly causes X and Y under the graph assumptions. X directly causes Y.

Edit graph

Variables

  • X Exposure, observed
  • Y Outcome, observed
  • Z Adjustment candidate, observed

Arrows

  • Z to X Z directly causes X, conditional on its other parents
  • Z to Y Z directly causes Y, conditional on its other parents
  • X to Y X directly causes Y, conditional on its other parents

Given this graph and a total-effect question:

Adjust for Z

  1. Z Minimum size: 1 variable
Condition on variables

This set leaves a non-causal path open.

Graph ready. One minimal sufficient adjustment set: Z.

Path reasoning

Causal path
X to Y, open
Backdoor path
X, Z, Y. Open until conditioned on Z.
Forbidden set
Y

Why not adjust?

Variables on a proper causal path and their descendants are forbidden for this total-effect question. Collider warnings name the path they affect.

Advanced graph editing and d-separation

Apply a compatible directed acyclic graph. Current work stays visible until the text is valid.

D-connected given the selected variables

Export

Interactive version

Graph editing requires JavaScript. The worked example and method remain available below.

How to draw a causal DAG

Start with variables as nodes and direct-cause assumptions as arrows. Choose an exposure and outcome, then use the worked confounder example to see how the graph changes the adjustment result.

Backdoor paths and the backdoor criterion

A backdoor path reaches the exposure through an incoming arrow. This instrument evaluates the proper back-door graph and the complete adjustment criterion for the supplied DAG.

Minimal sufficient adjustment sets

Minimal means that removing any member breaks sufficiency. It does not always mean minimum size; two inclusion-minimal sets can have different cardinalities.

Check d-separation

The compact query asks about the graph as drawn. The adjustment result asks a different question after removing exposure edges that begin proper causal paths.

Confounder, mediator, or collider

These roles are relative to a query and a path. A node can be a mediator on one path and a collider on another. The Berkson's paradox simulator shows the selected-sample consequence of collider bias.

Working with DAGitty

Paste the supported directed-DAG subset or export DAGitty text and R code. Machine syntax such as Z -> X stays explicit and copyable.

Assumptions, limits, and privacy

The graph is capped at 20 nodes and 40 arrows. Complete enumeration supports at most 10 eligible adjustment candidates. Graph state stays local unless you copy a fragment link. Compare the group-mix pattern in the Simpson's paradox simulator, then use linear regression only after the causal adjustment question is settled.

FAQ

What is a collider in a DAG?

A collider is a node where two arrows on a particular path point inward. The role belongs to that path, not permanently to the variable.

What is a mediator in a DAG?

A mediator lies on a directed causal path from the exposure to the outcome. It is forbidden for this tool's total-effect adjustment question.

Can a collider be a confounder?

A variable may have different roles on different paths, so the tool names the path or criterion behind each role.

What is the purpose of a DAG?

A DAG makes direct-cause assumptions explicit so their implications for adjustment and conditional independence can be inspected.

Why should I not control for a collider?

Conditioning on a collider or one of its descendants can open a path that was blocked before conditioning.

What does no valid adjustment set mean?

No set of represented observed covariates satisfies the supported total-effect adjustment criterion. Other identification strategies are outside this tool.

Does this prove causality?

No. Results are exact implications of the graph you supplied, not evidence that the graph represents the real system.

Does my graph leave my browser?

No. Analysis, sharing, storage, and export run locally. A fragment link contains the labels and state you chose to share.

What does DAG stand for?

Directed acyclic graph: arrows have direction, and no directed path can return to its starting node.

How adjustment sets are found

The logic constructs the forbidden set and proper back-door graph, tests d-separation, and enumerates candidate subsets in cardinality order. A result is called complete only when every eligible subset was checked.

Sources

  1. Complete Graphical Characterization and Construction of Adjustment Sets in Markov Equivalence Classes of Ancestral Graphs. Journal of Machine Learning Research. Retrieved .
  2. Bayes-Ball: The Rational Pastime. UAI. Retrieved .
  3. Robust causal inference using directed acyclic graphs: the R package dagitty. International Journal of Epidemiology. Retrieved .
  4. DAGitty User Manual. DAGitty. Retrieved .
  5. DoWhy guide to modeling causal relations. PyWhy. Retrieved .
  6. Causal diagrams for empirical research. Biometrika. Retrieved .