isCollider: Test for Colliders

Description Usage Arguments Examples

View source: R/dagitty.r

Description

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

Usage

1
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

1
2
3
4
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" )) )

Example output



dagitty documentation built on Jan. 21, 2021, 5:07 p.m.