data_med: Sample Dataset: Simple Mediation

data_medR Documentation

Sample Dataset: Simple Mediation

Description

A simple mediation model.

Usage

data_med

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.

Examples

library(lavaan)
data(data_med)
mod <-
"
m ~ a * x + c1 + c2
y ~ b * m + x + c1 + c2
ab := a * b
"
fit <- sem(mod, data_med, fixed.x = FALSE)
parameterEstimates(fit)

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