
Test Conditional Independence Implied by a DAG
dag_test_implications.RdGiven a causal DAG and observed data, tests all conditional independence relationships implied by the DAG's d-separation structure. Useful for evaluating whether the assumed DAG is compatible with the data.
Value
A data frame with columns: x, y,
conditioning_set, p_value, rejected (whether
the independence is rejected at alpha).
Examples
if (FALSE) { # \dontrun{
dag <- "dag{ X -> Y; Z -> X; Z -> Y }"
set.seed(1)
n <- 300
Z <- rnorm(n)
X <- 0.5 * Z + rnorm(n)
Y <- 0.3 * X + 0.4 * Z + rnorm(n)
df <- data.frame(X = X, Y = Y, Z = Z)
dag_test_implications(dag, df)
} # }