I'm trying to set up a mediated moderation model using lavaan but am unsure how to code it. I want to replicate Hayes process model number 7, but with two independent variables and an interaction between them. The independent variables are dummy coded, so I don't think I can just multiply them together to get the interaction term. But the moderator, mediator, and outcome variables are continuous.
Here's what my data looks like:
df <- data.frame( iv1 = c(rep(0, 50), rep(1, 50)),
iv2 = c(rep(c(0,1), 50)),
moderator = rnorm(mean = 5.19, n = 100, sd = 1.22),
mediator = rnorm(mean = 4.02, n = 100, sd = 1.90)
dv = rnorm(mean = 3.27, n = 100, sd = 1.35))
Thanks!