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

dag.ancestors

Identify ancestors of DAG nodes.


Description

This identifies those nodes in a DAG that are ancestors of the nodes specified, i.e. acc. to the model depicted by the DAG they causally precede those nodes. Internally called by dag.adjustment in the context of finding associations introduced by adjustment.

Usage

dag.ancestors(dag, A)

Arguments

dag

The DAG to be evaluated.

A

A vector of nodes for which ancestors are to be identified.

Value

A vector indicating which nodes are ancestors of those in A. Note that A actually is included at the beginning of the vector.

Author(s)

Lutz P Breitling <l.breitling@posteo.de>

See Also

Examples

dag6<-demo.dag6();
dag.draw(dag6);
dag.ancestors(dag6,4);
dag.ancestors(dag6,3);
dag.ancestors(dag6,2);
dag.ancestors(dag6,1);
dag.ancestors(dag6,7);

dagR

R Functions for Directed Acyclic Graphs

v1.2.0
GPL-2
Authors
Lutz P Breitling
Initial release
2021-04-17

We don't support your browser anymore

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