data_serial_parallel {manymome} | R Documentation |
Sample Dataset: Serial-Parallel Mediation
Description
A mediation model with both serial and parallel components.
Usage
data_serial_parallel
Format
A data frame with 100 rows and 7 variables:
- x
Predictor. Numeric.
- m11
Mediator 1 in Path 1. Numeric.
- m12
Mediator 2 in Path 1. Numeric.
- m2
Mediator in Path 2. Numeric.
- y
Outcome variable. Numeric.
- c1
Control variable. Numeric.
- c2
Control variable. Numeric.
Examples
library(lavaan)
data(data_serial_parallel)
mod <-
"
m11 ~ a11 * x + c1 + c2
m12 ~ b11 * m11 + x + c1 + c2
m2 ~ a2 * x + c1 + c2
y ~ b12 * m12 + b2 * m2 + m11 + x + c1 + c2
indirect1 := a11 * b11 * b12
indirect2 := a2 * b2
indirect := a11 * b11 * b12 + a2 * b2
"
fit <- sem(mod, data_serial_parallel,
meanstructure = TRUE, fixed.x = FALSE)
parameterEstimates(fit)[c(1, 4, 8, 11, 12, 34:36), ]
[Package manymome version 0.2.2 Index]