Help with dummy-coded interaction variables in a MIMIC model

53 views
Skip to first unread message

N Nuseibeh

unread,
Sep 8, 2020, 10:02:45 AM9/8/20
to lavaan
Hi everyone,

I'm new to SEM and to Lavaan so apologies if this is a straightforward question! My issue is with including (categorical, dummy-coded) interactions as predictors in a SEM model (I’m using Lavaan) and how to interpret the output.

The SEM model I'm trying to build has 3 latent variables as below:
  • Latent Variable 1: “Latent 1”
    • Measured by 9 indicator items, scored between 1 (“strongly disagree”) and 5 (“strongly agree”)
  • Latent Variable 2: “Latent 2”
    • Measured by 15 indicator items, scored between 1 (“strongly disagree”) and 7 (“strongly agree”)
  • Latent Variable 3: “Latent 3
    • Measured by 8 Learner items , scored between 1 (“strongly disagree”) and 7 (“strongly agree”)

It has 5 main predictor variables (all categorical, therefore dummy-coded), as below:

  • U Type (U1 = 1, U2 = 0)
  • Country (C1 = 1, C2 = 0)
  • SES (SESHigh = 1, SESLow = 0)
  • SSS  (SHigh = 1, SLow = 0)
  • F Type (F1 = 1, F2 = 0)
And then I want to include interactions between these :
  • U Type x Country
  • U Type x F Type
  • SES x F Type
  • Country x F Type
  • SSS x F Type
My issue is how best to include these interactions so that I can interpret the results correctly. As it stands, I have included included only ONE dummy picking up each 2x2 interaction, but then I'm not sure how to interpret the results when that product term is significant. Any help would be really really appreciated!

My code for this is :

library(semTools)
library(lavaan)
library(semPlot)

#data
data = MyData

#define MIMIC
MIMIC6 = '

#Measurement_model
Latent1 =~ A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9
Latent2=~ C1 + C2 + C3 + C4 + C5 + C6  + C7 + C8 + C9 + C10 + C11 + C12 + C13 + C14 + C15
Latent3 =~  L1 + L2 + L3 + L4 + L5 + L6 + L7 + L8

#Regress DV on group code IVs

Latent1 ~ ~ U1 + C1 + F1 + SESHigh + SHigh + U1xC1 + U1xF1 + SESHighxF1 + C1xF1 + SHighxF1

Consumer ~ U1 + C1 + F1 + SESHigh + SHigh + U1xC1 + U1xF1 + SESHighxF1 + C1xF1 + SHighxF1

Learner ~ ~ U1 + C1 + F1 + SESHigh + SHigh + U1xC1 + U1xF1 + SESHighxF1 + C1xF1 + SHighxF1
'
#run the model
MIMIC6.fit = sem(MIMIC6,
                 missing = "fiml",
                 data = MyData,
                 estimator = "MLR")

#examine the model
summary(MIMIC6.fit,
        standardized = T,
        rsquare = T,
        fit.measures = T)


Terrence Jorgensen

unread,
Sep 11, 2020, 4:40:38 AM9/11/20
to lavaan
My issue is how best to include these interactions so that I can interpret the results correctly. As it stands, I have included included only ONE dummy picking up each 2x2 interaction

If you already calculated your product terms as new variables in the data.frame, that is correct.  


But you could also use the colon operator as a shortcut:

Latent1 ~ U1 + C1 + F1 + SESHigh + SHigh + U1:C1 + U1:F1 + SESHigh:F1 + C1:F1 + SHigh:F1

FYI, you have an extra tilde after Latent1 and Learner.

then I'm not sure how to interpret the results when that product term is significant. 

Probe the interaction.  


You can label the paths and calculate user-defined parameters that represent the conditional effects you want to test.  For example, if U1:C1 is significant, and you want to probe the effect of U1 for each level of C1:

Latent1 ~ b_u1*U1 + b_c1*C1 + F1 + SESHigh + SHigh + b_int*U1xC1 + ...

## user-defined parameters to probe interaction
# b_u1 is already the effect of U1 when C1 == 0 (and F1 == 0)
b_u1_c1
:= b_u1 + b_int # effect of U1 when C1 == 1 (and F1 == 0)


Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Nuzha Nuseibeh

unread,
Sep 11, 2020, 8:53:29 AM9/11/20
to lav...@googlegroups.com
Thank you so much, Prof. Jorgensen!

Would I then have to run a completely new model with different reference categories in order to then find out the effects of U2xC1 and U2xC2?

Thank you!

--
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/U_W_33t60FA/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/57440bed-e47f-4281-b1c1-7f1b04d6b7afo%40googlegroups.com.


--
Nuzha Nuseibeh
PA to Don Paterson
DPhil (PhD) Candidate, University of Oxford
Co-founder, The Bluestocking Club

Terrence Jorgensen

unread,
Sep 14, 2020, 8:53:49 AM9/14/20
to lavaan
Would I then have to run a completely new model with different reference categories in order to then find out the effects of U2xC1 and U2xC2?

No, please read the quantpsy.org page I linked to before asking any more follow-up questions


I also showed you how to avoid that necessity in the syntax example I provided.  But changing reference categories is still a (more time-consuming) option.
Reply all
Reply to author
Forward
0 new messages