Learn R Programming

manymome (version 0.3.7)

data_mod_2w: Sample Dataset: Two Moderators (Version 2)

Description

A two-moderator model, with variation in the standard deviation of x related to one moderator.

Usage

data_mod_2w

Arguments

Format

A data frame with 200 rows and 6 variables:

y

Outcome variable. Numeric.

x

Predictor. Numeric.

w1

Moderator 1. Numeric.

w2

Moderator 2. Numeric.

c1

Control variable. Numeric.

c2

Control variable. Numeric.

Examples

Run this code
library(lavaan)
data(data_mod_2w)
lm_out <- lm(y ~ x*w1 + x*w2 + c1 + c2, data_mod_2w)
out <- cond_effects(
  wlevels = c("w1", "w2"),
  x = "x",
  fit = lm_out
)
out
plot(out, facet_grid_cols = "w1", graph_type = "tumble")
plot(out, facet_grid_cols = "w2", graph_type = "tumble")

Run the code above in your browser using DataLab