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