Using SEM, I want to test if the association between interpersonal attention and self-disclosure (both continuous variables) is moderated by group membership (a factor). To test this, I aim to include a dummy-coded (0, 1) moderator variable for group membership that is classified as a factor in my model (this is also the way I would normally do this in a classic regression model. A tutorial recommended dealing with categorical exogenous variables the same way in lavaan as in classic regression models, see https://lavaan.ugent.be/tutorial/cat.html). It seems that lavaan is unable to compute the interaction term when the moderator is classified as 'factor'. Is there a common solution to this issue?
I provide my model specification (note that this is just one part of the model, but it demonstrates my problem. I know that I would not need SEM for this model but I need it for the other parts of my analyses). There are no missing values on the variables selfdisclosure, attention and group membership:
test_interaction <- '
selfdisclosure ~ p*attention + h*group + int*attention:group
'
fit.test_interaction <- sem(test_interaction, data=data)
and the error message:
--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/JmE1BwIPCSk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/40d06b3d-87f3-496a-be2c-024c0d597cbdn%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit
test_nointeraction <- 'selfdisclosure ~ p*attention + h*group'
I have no problems with running my model and I do not have to correlate group with something.
Anyway, I tried your suggestion of correlating group with something (including the interaction term) but the error message remains the same. So, I guess you are right and I have to either calculate the interaction term manually or reconsider my model specification and use a multi-group approach.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/454877a2-4c98-4ba7-a4b7-2393ac6d7d21n%40googlegroups.com.