data_med_mod_b: Sample Dataset: Simple Mediation with b-Path Moderated

data_med_mod_bR Documentation

Sample Dataset: Simple Mediation with b-Path Moderated

Description

A simple mediation model with b-path moderated.

Usage

data_med_mod_b

Format

A data frame with 100 rows and 6 variables:

x

Predictor. Numeric.

w

Moderator. Numeric.

m

Mediator. Numeric.

y

Outcome variable. Numeric.

c1

Control variable. Numeric.

c2

Control variable. Numeric.

Examples

library(lavaan)
data(data_med_mod_b)
data_med_mod_b$mw <-
 data_med_mod_b$m *
 data_med_mod_b$w
mod <-
"
m ~ a * x + w + c1 + c2
y ~ b * m + x + d * mw + c1 + c2
w ~~ v_w * w
w ~ m_w * 1
ab := a * b
ab_lo := a * (b + d * (m_w - sqrt(v_w)))
ab_hi := a * (b + d * (m_w + sqrt(v_w)))
"
fit <- sem(mod, data_med_mod_b,
           meanstructure = TRUE, fixed.x = FALSE)
parameterEstimates(fit)[c(1, 5, 7, 10, 11, 30:32), ]

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