cg <- caugi(
A %-->% X,
X %-->% M,
M %-->% Y,
A %-->% Y,
class = "DAG"
)
# Find any minimal separator between X and Y
minimal_d_separator(cg, "X", "Y")
# Force M to be in the separator
minimal_d_separator(cg, "X", "Y", I = "M")
# Restrict separator to only {A, M}
minimal_d_separator(cg, "X", "Y", R = c("A", "M"))
Run the code above in your browser using DataLab