View source: R/coef_indirect_list.R
coef.indirect_list | R Documentation |
Return the estimates of
the indirect effects in the output of
many_indirect_effects()
.
## S3 method for class 'indirect_list'
coef(object, ...)
object |
The output of
|
... |
Optional arguments. Ignored by the function. |
It extracts the estimates in each 'indirect'-class object in the list.
If standardized effect is requested
when calling many_indirect_effects()
,
the effects
returned are also standardized.
A numeric vector of the indirect effects.
many_indirect_effects()
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 from x to y
paths <- all_indirect_paths(fit,
x = "x",
y = "y")
paths
# Indirect effect estimates
out <- many_indirect_effects(paths,
fit = fit)
out
coef(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.