Multilevel Path Model: Centered vs. uncentered moderator

135 views
Skip to first unread message

LaDi

unread,
Apr 2, 2025, 12:01:04 PMApr 2
to lavaan
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

Terrence Jorgensen

unread,
Apr 4, 2025, 7:07:45 AMApr 4
to lavaan
I would be grateful if someone could help me understand why re-scaling the moderator creates this issue

A reprex could help reveal the problem.

Terrence D. Jorgensen    (he, him, his)
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam
http://www.uva.nl/profile/t.d.jorgensen

 

LaDi

unread,
Apr 8, 2025, 10:34:37 AMApr 8
to lavaan
Please find a repex attached. I hope it helps narrow down the issue.
repex_data.csv
RepEx_Code.R

LaDi

unread,
Apr 22, 2025, 12:55:19 PMApr 22
to lavaan
Hi everyone!

I'm still puzzled by this and would greatly appreciate any input you may have.

All the best!
Lara
Message has been deleted

Terrence Jorgensen

unread,
Jun 13, 2025, 3:56:50 AMJun 13
to lavaan
I tried replying twice yesterday, and it indicates a message was deleted.  This is just a test whether I can reply here.

Sunday Ogbu

unread,
Jun 14, 2025, 7:18:13 AMJun 14
to lav...@googlegroups.com
Nice

On Fri, Jun 13, 2025 at 8:56 AM Terrence Jorgensen <tjorge...@gmail.com> wrote:
I tried replying twice yesterday, and it indicates a message was deleted.  This is just a test whether I can reply here.

--
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 visit https://groups.google.com/d/msgid/lavaan/e128c06e-8250-4af5-affe-a7810e6dcc78n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages