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

AncestralRelations

Ancestral Relations


Description

Retrieve the names of all variables in a given graph that are in the specified ancestral relationship to the input variable v.

Usage

descendants(x, v)

ancestors(x, v)

children(x, v)

parents(x, v)

neighbours(x, v)

spouses(x, v)

adjacentNodes(x, v)

markovBlanket(x, v)

Arguments

x

the input graph, of any type.

v

name(s) of variable(s).

descendants(x,v) retrieves variables that are are reachable from v via a directed path.

ancestors(x,v) retrieves variables from which v is reachable via a directed path.

children(x,v) finds all variables w connected to v by an edge v -> w.

parents(x,v) finds all variables w connected to v by an edge w -> v.

markovBlanket(x,v) returns x's parents, its children, and all other parents of its children. The Markov blanket always renders x independent of all other nodes in the graph.

By convention, descendants(x,v) and ancestors(x,v) include v but children(x,v) and parents(x,v) do not.

Examples

g <- dagitty("graph{ a <-> x -> b ; c -- x <- d }")
descendants(g,"x")
parents(g,"x")
spouses(g,"x")

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.