Print the content of 'all_paths'-class object,
which can be generated by all_indirect_paths()
.
Usage
# S3 method for class 'all_paths'
print(x, ...)
Author
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
Examples
library(lavaan)
data(data_serial_parallel)
mod <-
"
m11 ~ x + c1 + c2
m12 ~ m11 + x + c1 + c2
m2 ~ x + c1 + c2
y ~ m12 + m2 + m11 + x + c1 + c2
"
fit <- sem(mod, data_serial_parallel,
fixed.x = FALSE)
# All indirect paths
out1 <- all_indirect_paths(fit)
out1
#> Call:
#> all_indirect_paths(fit = fit)
#> Path(s):
#> path
#> 1 m11 -> m12 -> y
#> 2 x -> m11 -> m12
#> 3 x -> m11 -> m12 -> y
#> 4 x -> m11 -> y
#> 5 x -> m12 -> y
#> 6 x -> m2 -> y
#> 7 c1 -> m11 -> m12
#> 8 c1 -> m11 -> m12 -> y
#> 9 c1 -> m11 -> y
#> 10 c1 -> m12 -> y
#> 11 c1 -> m2 -> y
#> 12 c2 -> m11 -> m12
#> 13 c2 -> m11 -> m12 -> y
#> 14 c2 -> m11 -> y
#> 15 c2 -> m12 -> y
#> 16 c2 -> m2 -> y