Observed and latent variable interaction terms in R (lavaan) - compared to Mplus

246 views
Skip to first unread message

Philipp Heintz

unread,
Jul 28, 2023, 4:50:11 PM7/28/23
to lavaan
Dear all,

I am currently facing a problem when building interation terms between observed and latent variables with R (lavaan).

As a part of my SEM, I want to create an interaction term between my IV (observed dichotomous variable that I contrast-coded (-0,5 or 0,5) according to its two experimental conditions) and my moderator MOD (latent variable with 5 indicators MOD1-5).

In Mplus, I am using the xwith-command to create the interaction term.

R does not provide such a command. During my research, I read about the indProd function and the benefits of double mean centering. However, the following does not provide me with a solution that corresponds with the output of Mplus.  

...

dataset_dmc <- indProd(mydataset, var1 = c("IV"),

                    var2 = c("MOD1", "MOD2", "MOD3", "MOD4", "MOD5"),

                    match = FALSE, meanC = TRUE,

                    residualC = FALSE, doubleMC = TRUE)

IVxMOD =~ IV.MOD1+ IV.MOD2 + IV.MOD3 + IV.MOD4 + IV.MOD5

...

"

Adding this interaction term into my path analysis provides me with strange results that have nothing in common with the output from Mplus.

Put simply: How can I build the correct interaction term for my variable specification? What is Mplus actually doing when applying the xwith command - is it even possible to exactly reproduce the Mplus output in R for this type of interaction?

Thank you very much for your help!

Best,

Philipp

Christian Arnold

unread,
Jul 29, 2023, 3:23:11 AM7/29/23
to lav...@googlegroups.com
Hi Philipp,

I can't answer what MPlus does. Detatched from that, If I understand you correctly, then you have two groups and you want to test if one or more effects are different depending on the group? If so, then this is a typical use case for a multigroup analysis.Thus, you don't need to include artifacts (product indicators) in the model and you can test for invariance.

HTH

Christian 


Von: 'Philipp Heintz' via lavaan <lav...@googlegroups.com>
Gesendet: Freitag, Juli 28, 2023 10:50:20 PM
An: lavaan <lav...@googlegroups.com>
Betreff: Observed and latent variable interaction terms in R (lavaan) - compared to Mplus
--
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 https://groups.google.com/d/msgid/lavaan/12ac019d-1170-4771-afe7-77d0b575b461n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages