39 Directed Acyclic Graph
Native R:
dagitty
ggdag
dagR
r-causal
: by Center for Causal Discovery. Also available in Python
Publication-ready (with R
and Latex
): shinyDAG
Standalone program: DAG program by Sven Knuppel
39.1 Basic Notations
Basic building blocks of DAG
-
Mediators (chains): X→Z→Y
- controlling for Z blocks (closes) the causal impact of X→Y
-
Common causes (forks): X←Z→Y
Z (i.e., confounder) is a common cause in which it induces a non-causal association between X and Y.
Controlling for Z should close this association.
Z d-separates X from Y when it blocks (closes) all paths from X to Y (i.e., X⊥Y|Z). This applies to both common causes and mediators.
-
Common effects (colliders): X→Z←Y
Not controlling for Z does not induce an association between X and Y
Controlling for Z induces a non-causal association between X and Y
Notes:
A descendant of a variable behavior similarly to that variable (e.g., a descendant of Z can behave like Z and partially control for Z)
-
Rule of thumb for multiple Controls: o have Causal inference X→Y, we must
Close all backdoor path between X and Y (to eliminate spurious correlation)
Do not close any causal path between X and Y (any mediators).