Mental model

DAGs and Regression Models

Use causal diagrams (DAGs) as a blueprint to build more accurate and less biased statistical regression models.

Discover

You want to know if a new wellness program *truly* reduces employee sick days. You have data on program participation, sick days, and employees' pre-existing health conditions.

To build a reliable statistical model, what's your FIRST step?

Let's see why the order matters.

Understand

Understand

A Directed Acyclic Graph (DAG) is a blueprint for building a regression model that can estimate causal effects. It visually maps your assumptions, showing which variables you must control for to isolate the relationship you care about. For example, to test if a new running shoe causes faster race times, a DAG reminds you to control for the runner's training hours, which affects both shoe choice and speed. Without this map, you might get misleading results.

Try this: Before an analysis, sketch out your assumptions of how the variables influence one another.

Full explanation

Full explanation

Using a Directed Acyclic Graph (DAG) translates your causal theory into a statistical model specification. It ensures the model reflects your assumptions about reality, preventing common errors that arise from including or excluding the wrong variables.

The primary goal is to statistically estimate the total causal effect of a treatment (X) on an outcome (Y). To do this, you must use the DAG to identify and block non-causal alternate routes, known as "backdoor paths," while leaving the causal pathways open. This involves key rules for variable selection.

First, you must control for confounders. These are variables that are a common cause of both X and Y. In a study of a management course (X) on project success (Y), manager experience is a likely confounder. Experienced managers may be more likely to take the course and also more likely to lead successful projects. Including it in the model blocks this non-causal path.

Second, you must not control for colliders. A collider is a variable that is a common effect of two other variables. For example, imagine both creativity and technical skill increase the chances of an employee getting a promotion. Here, promotion is a collider. If you study only promoted employees (i.e., control for promotion), you can create a spurious association between creativity and technical skill, even if they are unrelated in the general population.

Third, you must not control for mediators if your goal is the total causal effect. A mediator is a variable on the causal path between X and Y. Controlling for it would block a part of the effect you want to measure, giving you only the direct effect. You must also avoid controlling for any descendants of colliders.

The output is a regression model with a precise list of variables to include (treatment, outcome, and all necessary confounders). This method gives your statistical estimates a much stronger claim to being causal.

Research

Research

Directed Acyclic Graphs (DAGs) offer a formal language for translating causal assumptions into specific criteria for selecting control variables in statistical models [1, 4].

  • The primary tool for this translation is the 'back-door criterion,' which provides a graphical rule for identifying a set of variables that, if controlled for, will yield an unbiased estimate of a causal effect [1, 2]. [1] (2009)
  • DAGs also make explicit the risk of 'collider bias,' a form of endogenous selection bias that arises from controlling for a common effect of two other variables, which can create spurious associations [3]. (2014)

Limitations

Limitations

A DAG-based analysis is only as valid as the causal assumptions embedded in the graph itself. If the DAG is an incorrect representation of reality (e.g., a causal arrow is missing or pointing the wrong way), the resulting regression model will be misspecified. Furthermore, DAGs can identify necessary variables to control for, but they cannot help if you lack data on a critical confounder—a situation known as unmeasured confounding.

Try it

Synthesize

Choose a pattern from the guide, then pick an action to try with it.

Which pattern stands out?

What will you try?

Choose a pattern above to select an action.

Sources

Sources

Try it

Check your understanding

You've drawn a DAG to study if a new fertilizer (F) increases crop yield (Y). You identify that soil quality (S) affects both which farms use the fertilizer and the final yield. What is the correct action for your regression model?

Show the guide's explanation

Answer: Include soil quality as a control variable

Soil quality is a common cause (a confounder) of both the treatment (fertilizer) and outcome (yield). The DAG tells you that you must control for it to block the non-causal 'backdoor path' and get a better estimate of the fertilizer's true effect.

A researcher studies the link between having a gym membership (G) and cholesterol (C). They control for 'visits to the doctor' (D), since both G and C might influence D. What mistake might this introduce?

Show the guide's explanation

Answer: Creating collider bias

'Visits to the doctor' is a common effect (a collider) of the variables of interest. Controlling for a collider can create a spurious, misleading statistical association where none exists.

Which question is a DAG *best* suited to help you answer *before* you run a regression analysis?

Show the guide's explanation

Answer: Which variables should I include to estimate a causal effect?

A DAG's primary function is strategic. It's a thinking tool used before analysis to map causal assumptions and determine the right set of control variables to isolate an effect and avoid common biases.

Keep exploring

Find another idea for the decision in front of you.

The complete Reframo library is free to read. Explore another guide whenever you are ready.

DAGs and Regression Models | Reframo