powered by
Labels each node by causal role in a console tabular grid. This function is mostly used as an internal helper, but can be used on its own. Users are encouraged to alternatively use DAGassist::DAGassist(show=roles) for role table specific output.
DAGassist::DAGassist(show=roles)
classify_nodes(dag, exposure, outcome)
A data.frame with one row per node and columns:
variable (node name)
variable
logical flags: is_exposure, is_outcome, is_confounder, is_mediator, is_collider, is_neutral_on_treatment, is_neutral_on_outcome, is_descendant_of_mediator, is_descendant_of_collider, is_descendant_of_confounder_on_bdp, is_descendant_of_confounder_off_bdp
is_exposure
is_outcome
is_confounder
is_mediator
is_collider
is_neutral_on_treatment
is_neutral_on_outcome
is_descendant_of_mediator
is_descendant_of_collider
is_descendant_of_confounder_on_bdp
is_descendant_of_confounder_off_bdp
role (a single primary label)
role
A dagitty DAG object.
dagitty
Optional-- inferred from DAG if not set; character; exposure node name (Exp.).
Optional-- inferred from DAG if not set; character; outcome node name (Out.).
d1 <- dagitty::dagitty("dag {X[exposure];Y[outcome] Z -> X; Z -> Y; X -> Y }") classify_nodes(d1)
Run the code above in your browser using DataLab