# Grafy przyczynowe (DAG) i dobór zmiennych do kontroli

EN: **Causal graphs (DAGs) and backdoor adjustment** · id `causaldags` · aliases: causal DAG, causal graph, causal diagram, graf przyczynowy, diagram przyczynowy

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Fundamenty i rozumowanie](https://aiatlasgraph.com/t/foundations.md) › [Modele probabilistyczne](https://aiatlasgraph.com/t/probabilistic.md) › [Wnioskowanie przyczynowe](https://aiatlasgraph.com/t/causalinference.md) › Grafy przyczynowe (DAG) i dobór zmiennych do kontroli

## Description

- PL: Skierowany graf acykliczny koduje założenia przyczynowe; d-separacja i kryterium backdoor wskazują zmienne, których kontrola identyfikuje efekt.
- EN: A directed acyclic graph encodes causal assumptions; d-separation and the backdoor criterion identify which variables to adjust for to recover an effect.

## In one sentence

- PL: Rysunek ze strzałkami pokazuje, co na co wpływa, i podpowiada, które czynniki trzeba uwzględnić w analizie.
- EN: A drawing with arrows shows what influences what and tells you which factors to account for in an analysis.

## Problem it solves

- PL: Dodanie do analizy niewłaściwej zmiennej potrafi stworzyć fałszywą zależność albo ukryć prawdziwą, a z samych liczb tego nie widać.
- EN: Adding the wrong variable to an analysis can create a false link or hide a real one, and the numbers alone will not show it.

## What it does

- PL: Jak mapa dróg: widzisz wszystkie objazdy łączące przyczynę ze skutkiem i zamykasz te, które prowadzą okrężną, mylącą trasą.
- EN: Like a road map: you see every detour linking cause and effect and close the ones that take a misleading roundabout route.

## Everyday example

- PL: Chcesz wiedzieć, czy kawa szkodzi sercu. Zaznaczasz, że palenie wpływa i na picie kawy, i na serce, więc palenie musisz uwzględnić.
- EN: You want to know whether coffee harms the heart. You draw that smoking affects both coffee drinking and the heart, so smoking must be accounted for.

## This concerns you if you…

- PL: porównujesz grupy w danych, których nie zebrano w eksperymencie
- PL: nie wiesz, które zmienne dodać do analizy
- PL: chcesz jasno zapisać swoje założenia
- EN: compare groups in data not collected by experiment
- EN: are unsure which variables to include in an analysis
- EN: want to write down your assumptions clearly

## Keywords

d-separation · backdoor criterion · frontdoor criterion · do-calculus · structural causal model · collider bias · DAGitty · DoWhy

## How it works

- PL: Węzły to zmienne, strzałki to bezpośrednie wpływy. Łańcuchy i rozwidlenia przenoszą zależność, którą blokuje warunkowanie na zmiennej środkowej; kolider blokuje ścieżkę, dopóki się na nim nie warunkuje. Kryterium backdoor wybiera zmienne zamykające wszystkie ścieżki tylne od przyczyny do skutku, a do-rachunek uogólnia identyfikację, np. na kryterium frontdoor.
- EN: Nodes are variables and arrows are direct influences. Chains and forks transmit dependence, blocked by conditioning on the middle variable; a collider blocks a path unless conditioned on. The backdoor criterion selects variables closing every backdoor path from cause to outcome, and do-calculus generalises identification, e.g. to the frontdoor criterion.

## Limits

- PL: Graf jest założeniem, nie wynikiem z danych: pominięta strzałka lub niezmierzony zakłócacz daje błędny efekt. Warunkowanie na kolidrze lub mediatorze wprowadza błąd selekcji. Graf mówi, co kontrolować, ale nie jak dobrze oszacować efekt.
- EN: The graph is an assumption, not a data result: a missing arrow or unmeasured confounder yields a wrong effect. Conditioning on a collider or mediator introduces selection bias. The graph says what to adjust for, not how to estimate well.

## Key terms

- PL: **zakłócacz (confounder)**: Wspólna przyczyna działania i wyniku.
- PL: **kolider**: Zmienna zależna od dwóch innych; warunkowanie na niej tworzy fałszywy związek.
- PL: **ścieżka tylna (backdoor)**: Niepożądana droga od przyczyny do skutku przez wspólne przyczyny.
- PL: **do-rachunek**: Reguły zamiany pytań o interwencję na wyrażenia z obserwacji.
- EN: **confounder**: A common cause of the action and the outcome.
- EN: **collider**: A variable caused by two others; conditioning on it creates a spurious link.
- EN: **backdoor path**: An unwanted route from cause to outcome through common causes.
- EN: **do-calculus**: Rules turning questions about interventions into expressions over observations.

## Know first

- [Sieci bayesowskie (Bayesian networks)](https://aiatlasgraph.com/t/bayesnets.md)

## Sources

- [Matheus Facure · Causal Inference for the Brave and True (online handbook with Python code)](<https://matheusfacure.github.io/python-causality-handbook/>) `facure-brave-true` · by Matheus Facure
- [Scott Cunningham · Causal Inference: The Remix (2nd edition of “The Mixtape”, online version)](<https://mixtape.scunning.com/>) `cunningham-mixtape-remix` · by Scott Cunningham
- [DoWhy (PyWhy) – causal inference library repository](<https://github.com/py-why/dowhy>) `pywhy-dowhy-repo` · by PyWhy contributors

---

AI Atlas revision 131 (2026-11-07) · HTML: https://aiatlasgraph.com/t/causaldags · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-11-07
