data_serial {manymome} | R Documentation |
Sample Dataset: Serial Mediation
Description
A serial mediation model.
Usage
data_serial
Format
A data frame with 100 rows and 6 variables:
- x
Predictor. Numeric.
- m1
Mediator 1. Numeric.
- m2
Mediator 2. Numeric.
- y
Outcome variable. Numeric.
- c1
Control variable. Numeric.
- c2
Control variable. Numeric.
Examples
library(lavaan)
data(data_serial)
mod <-
"
m1 ~ a * x + c1 + c2
m2 ~ b1 * m1 + x + c1 + c2
y ~ b2 * m2 + m1 + x + c1 + c2
indirect := a * b1 * b2
"
fit <- sem(mod, data_serial,
meanstructure = TRUE, fixed.x = FALSE)
parameterEstimates(fit)[c(1, 4, 8, 28), ]
[Package manymome version 0.2.2 Index]