powered by
Returns TRUE if three given variables form a collider in a given graph.
TRUE
isCollider(x, u, v, w)
the input graph, a DAG.
the first endpoint of the putative collider
the midpoint of the putative collider
the second endpoint of the putative collider
g1 <- dagitty("dag{X -> Y -> Z}") stopifnot( isTRUE(!isCollider( g1, "X", "Y", "Z" )) ) g2 <- dagitty("dag{X -> Y <- Z }") stopifnot( isTRUE(isCollider( g2, "X", "Y", "Z" )) )
Run the code above in your browser using DataLab