data_parallel: Sample Dataset: Parallel Mediation

data_parallelR Documentation

Sample Dataset: Parallel Mediation

Description

A parallel mediation model.

Usage

data_parallel

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_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), ]

manymome documentation built on Oct. 4, 2024, 5:10 p.m.