lavaanToGraph: Convert Lavaan Model to DAGitty Graph

Description Usage Arguments Examples

Description

The lavaan package is a popular package for structural equation modeling. To provide interoperability with lavaan, this function converts models specified in lavaan syntax to dagitty graphs.

Usage

1

Arguments

x

data frame, lavaan parameter table such as returned by lavaanify.

...

Not used.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
if( require(lavaan) ){
mdl <- lavaanify("
X ~ C1 + C3
M ~ X + C3
Y ~ X + M + C3 + C5
C1 ~ C2
C3 ~ C2 + C4
C5 ~ C4
C1 ~~ C2 \n C1 ~~ C3 \n C1 ~~ C4 \n C1 ~~ C5
C2 ~~ C3 \n C2 ~~ C4 \n C2 ~~ C5
C3 ~~ C4 \n C3 ~~ C5",fixed.x=FALSE)
plot( graphLayout( lavaanToGraph( mdl ) ) )
}

Example output

Loading required package: lavaan
This is lavaan 0.5-23.1097
lavaan is BETA software! Please report any bugs.

dagitty documentation built on May 2, 2019, 5:53 p.m.