data_med_mg: Sample Dataset: Simple Mediation With Two Groups

data_med_mgR Documentation

Sample Dataset: Simple Mediation With Two Groups

Description

A simple mediation model with two groups.

Usage

data_med_mg

Format

A data frame with 100 rows and 5 variables:

x

Predictor. Numeric.

m

Mediator. Numeric.

y

Outcome variable. Numeric.

c1

Control variable. Numeric.

c2

Control variable. Numeric.

group

Group variable. Character. "Group A" or "Group B"

Examples

library(lavaan)
data(data_med_mg)
mod <-
"
m ~ c(a1, a2) * x + c1 + c2
y ~ c(b1, b2) * m + x + c1 + c2
a1b1 := a1 * b1
a2b2 := a2 * b2
abdiff := a2b2 - a1b1
"
fit <- sem(mod, data_med_mg, fixed.x = FALSE,
           group = "group")
parameterEstimates(fit)

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