Learn R Programming

causalDisco (version 0.9.5)

plot.pag: Plot partial ancestral graph (PAG)

Description

Plot partial ancestral graph (PAG)

Usage

# S3 method for pag
plot(x, ...)

Value

No return value, the function is called for its side-effects (plotting).

Arguments

x

pag object to be plotted (as outputted from fci).

...

Currently not in use.

Author

This code is a modification of the fciAlgo plotting method implemented in the pcalg package.

Examples

Run this code
# simulate linear Gaussian data w unobserved variable L1
n <- 100
L1 <- rnorm(n) 
X1 <- rnorm(n)
X2 <- L1 + X1 + rnorm(n)
X3 <- X1 + rnorm(n)
X4 <- X3 + L1 + rnorm(n)
d <- data.frame(p1_X1 = X1,
                p1_X2 = X2,
                p2_X3 = X3,
                p2_X4 = X4)

# use FCI algorithm to recover PAG                
res <- fci(d, test = corTest)

# plot
plot(res)

Run the code above in your browser using DataLab