Goals:

  • Show that \(Y(w) \perp\!\!\!\perp W \mid X\) can be extracted from a SWIG


DAG

Define and plot the DAG representing the structural causal model \[\begin{align*} X = & f_X(U_X) \\ W = & f_W(X,U_W) \\ Y = & f_Y(W,X,U_Y) \end{align*}\]

using the dagitty infrastructure

library(tidyverse)  # For ggplot2 and friends
library(dagitty)    # For dealing with DAG math
library(ggdag)      # For making DAGs with ggplot

# DAG
dag = dagitty('dag{
W [exposure,pos = "1,1"]
Y [outcome,pos = "2,1"]
X [pos = "1,0.5"]
W -> Y
X -> W
X -> Y
}')

ggdag(dag) + theme_dag()

Check which (conditional) independences between observed variables are implied by the DAG:

impliedConditionalIndependencies(dag)

Not surprisingly none.



SWIG

Define and plot the SWIG implied by the structural causal model \[\begin{align*} X = & f_X(U_X) \\ W = & f_W(X,U_W) \\ Y = & f_Y(W,X,U_Y) \end{align*}\]

swig = dagitty('dag{
W [exposure,pos = "1,1"]
Yw [outcome,pos = "2,1"]
w [pos = "1.2,1"]
X [pos = "1,0.5"]
w -> Yw
X -> W
X -> Yw
}')

ggdag(swig) + theme_dag()

and observe that it implies the standard independence \(Y(w) \perp\!\!\!\perp W \mid X\) that is known as - Backdoor adjustment - Conditional independence assumption - Exogeneity - Ignorability - Measured confounding - No unmeasured confounding - Selection-on-observables - Unconfoundedness - …

impliedConditionalIndependencies(swig)
W _||_ Yw | X
W _||_ w
X _||_ w
LS0tDQp0aXRsZTogIkNhdXNhbCBJbmZlcmVuY2U6IERBRyBhbmQgU1dJRyB3aXRoIHZhbGlkIGFkanVzdG1lbnQgc2V0Ig0Kc3VidGl0bGU6ICJBcHBsaWNhdGlvbiBub3RlYm9vayINCmF1dGhvcjogIk1pY2hhZWwgS25hdXMiDQpkYXRlOiAiYHIgZm9ybWF0KFN5cy50aW1lKCksICclbS8leScpYCINCm91dHB1dDogDQogIGh0bWxfbm90ZWJvb2s6DQogICAgdG9jOiB0cnVlDQogICAgdG9jX2Zsb2F0OiB0cnVlDQogICAgY29kZV9mb2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