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

moralize

Moral Graph


Description

Graph obtained from x by (1) “marrying” (inserting an undirected ede between) all nodes that have common children, and then replacing all edges by undirected edges. If x contains bidirected edges, then all sets of nodes connected by a path containing only bidirected edges are treated like a single node (see Examples).

Usage

moralize(x)

Arguments

x

the input graph, a DAG, MAG, or PDAG.

Examples

# returns a complete graph
moralize( "dag{ x->m<-y }" )
# also returns a complete graph
moralize( "dag{ x -> m1 <-> m2 <-> m3 <-> m4 <- y }" )

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.