canonicalize: Canonicalize an Ancestral Graph

Description Usage Arguments Value Examples

View source: R/dagitty.r

Description

Takes an input ancestral graph (a graph with directed, bidirected and undirected edges) and converts it to a DAG by replacing every bidirected edge x <-> y with a substructure x <- L -> y, where L is a latent variable, and every undirected edge x – y with a substructure x -> S <- y, where S is a selection variable. This function does not check whether the input is actually an ancestral graph.

Usage

1

Arguments

x

the input graph, a DAG or MAG.

Value

A list containing the following components:

Examples

1
canonicalize("mag{x<->y--z}") # introduces two new variables

Example output

$g
[1] "dag {\nL1 [latent]\nS1 [selected]\nx\ny\nz\nL1 -> x\nL1 -> y\ny -> S1\nz -> S1\n}\n"
attr(,"class")
[1] "dagitty"

$L
[1] "L1"

$S
[1] "S1"

dagitty documentation built on Jan. 21, 2021, 5:07 p.m.