Learn R Programming

manymome (version 0.3.7)

data_mod_cat_num_2w: Sample Dataset: Mixed Moderators

Description

A two-moderator model, one categorical and one numerical.

Usage

data_mod_cat_num_2w

Arguments

Format

A data frame with 600 rows and 6 variables:

y

Outcome variable. Numeric.

x

Predictor. Numeric.

w

Moderator 2. Numeric.

city

Moderator 1. String: "City A" and "City B".

c1

Control variable. Numeric.

c2

Control variable. Numeric.

Examples

Run this code
data(data_mod_cat_num_2w)
lm_out <- lm(y ~ x*city*w + c1 + c2, data_mod_cat_num_2w)
out <- cond_effects(
  wlevels = c("city", "w"),
  x = "x",
  fit = lm_out
)
out
plot(out, facet_grid_cols = "city", graph_type = "tumble")

Run the code above in your browser using DataLab