data_med_mg {manymome} | R 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)
[Package manymome version 0.2.2 Index]