Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

isCollider

Test for Colliders


Description

Returns TRUE if three given variables form a collider in a given graph.

Usage

isCollider(x, u, v, w)

Arguments

x

the input graph, a DAG.

u

the first endpoint of the putative collider

v

the midpoint of the putative collider

w

the second endpoint of the putative collider

Examples

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" )) )

dagitty

Graphical Analysis of Structural Causal Models

v0.3-1
GPL-2
Authors
Johannes Textor, Benito van der Zander, Ankur Ankan
Initial release
2021-01-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.