data_parallel | R Documentation |
A parallel mediation model.
data_parallel
A data frame with 100 rows and 6 variables:
Predictor. Numeric.
Mediator 1. Numeric.
Mediator 2. Numeric.
Outcome variable. Numeric.
Control variable. Numeric.
Control variable. Numeric.
library(lavaan)
data(data_parallel)
mod <-
"
m1 ~ a1 * x + c1 + c2
m2 ~ a2 * x + c1 + c2
y ~ b2 * m2 + b1 * m1 + x + c1 + c2
indirect1 := a1 * b1
indirect2 := a2 * b2
indirect := a1 * b1 + a2 * b2
"
fit <- sem(mod, data_parallel,
meanstructure = TRUE, fixed.x = FALSE)
parameterEstimates(fit)[c(1, 4, 7, 8, 27:29), ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.