mag <- cgraph(A %<->% X, A %-->% M, M %-->% Y, X %-->% Y, class = "MAG")
possible_d_sep(mag, "X", "Y")
#> [1] "A" "M" "Y"
backdoor_set(mag, "X", "Y") # M_X drops X --> Y
#> [1] "A"

Find the D-SEP set of two nodes
Source: R/identification.R
Description
Returns D-SEP(x, y, cg). It contains every vertex other than x for which there is a collider path between x and the vertex in cg on which every vertex, including the vertex itself, is an ancestor of x or of some member of y. backdoor_set() uses this set to build its generalized back-door set for a MAG or PAG.
Usage
possible_d_sep(cg, x, y)Arguments
cg
|
An AG-family (AG, MAG) graph created with cgraph().
|
x
|
Node name. |
y
|
Node name, or character vector of node names. |
Value
Sorted character vector of node names.
References
Maathuis MH, Colombo D (2015). “A generalized back-door criterion.” The Annals of Statistics, 43(3), 1060–1088.