Dear lavaan-specialists,
I have run into a - to me - somewhat confusing problem.
I am attempting to test a multi level path model similar to a moderated mediation. All variables are observed, my exogeneous variable is categorical (coded -1, 1), my mediators (M1&M2) are continuous, and my outcome is continuous. My moderator (W) is continuous. I have four clusters (overall N = 1400, smallest cluster has 140+ observations) and have specified the same model on Level 1 and 2, as I simply want to account for two individuals from one cluster being more similar to each other than two individuals from different clusters.
My model looks like this:
Level:1
Y ~ b1*M1+b2*M2+cd*X+mod*W+w1*M1:W+w2*M2:W+w3*X:W
M1 ~ a1*X
M2 ~ a2*X
Level:2
Y ~ b1*M1+b2*M2+cd*X+mod*W+w1*M1:W+w2*M2:W+w3*X:W
M1 ~ a1*X
M2 ~ a2*X
If I use the moderator W in its non-centered form (scaled 1-7), the model estimation completes without a hitch.
However, if I use a grand-mean centered version of the moderator (centered across clusters), model estimation fails and I get the following errors:
1: lavaan->lav_lavaan_step11_estoptim(): Model estimation FAILED! Returning starting values.
2: lavaan->lav_lavaan_step11_estoptim(): Model estimation FAILED! Returning starting values.
3: lavaan->lav_lavaan_step15_baseline(): estimation of the baseline model failed.
I would be grateful if someone could help me understand why re-scaling the moderator creates this issue. Also, as I suspect the issue might be with the interactions, would it be an appropriate workaround to just compute the interactions outside lavaan and then use them as regular predictors?
Kind regards,
Lara