Test if Variable Is Collider | R Documentation |
Detecting colliders in DAGs
is_collider(.dag, .var, downstream = TRUE)
is_downstream_collider(.dag, .var)
.dag |
an input graph, an object of class |
.var |
a character vector of length 1, the potential collider to check |
downstream |
Logical. Check for downstream colliders? Default is |
Logical. Is the variable a collider or downstream collider?
dag <- dagify(m ~ x + y, m_jr ~ m)
is_collider(dag, "m")
is_downstream_collider(dag, "m_jr")
# a downstream collider is also treated as a collider
is_collider(dag, "m_jr")
# but a direct collider is not treated as a downstream collider
is_downstream_collider(dag, "m")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.