activate_collider_paths: Activate paths opened by stratifying on a collider

View source: R/colliders.R

activate_collider_pathsR Documentation

Activate paths opened by stratifying on a collider

Description

Stratifying on colliders can open biasing pathways between variables. activate_collider_paths activates any such pathways given a variable or set of variables to adjust for and adds them to the tidy_dagitty.

Usage

activate_collider_paths(.tdy_dag, adjust_for, ...)

Arguments

.tdy_dag

input graph, an object of class tidy_dagitty or dagitty

adjust_for

a character vector, the variable(s) to adjust for.

...

additional arguments passed to tidy_dagitty()

Value

a tidy_dagitty with additional rows for collider-activated pathways

See Also

control_for(), ggdag_adjust(), geom_dag_collider_edges()

Examples

dag <- dagify(m ~ x + y, x ~ y)

collided_dag <- activate_collider_paths(dag, adjust_for = "m")
collided_dag


malcolmbarrett/ggdag documentation built on March 8, 2024, 5:49 p.m.