Interaction latent and observed variable using indProd

415 views
Skip to first unread message

e.s.tw...@gmail.com

unread,
Jun 21, 2023, 12:56:30 PM6/21/23
to lavaan
Dear all,
I’m trying to fit several models with an interaction of a latent variable and an observed continuous variable. I followed the approach as described in Schoemann & Jorgensen (2021), although their example has an interaction of two latent variables instead of one latent and one observed as in my case. For each model I tested so far, I get multiple error/warning messages so I believe I’m doing something wrong. I hope any of you could give me some guidance.

The code of one of my models:
dat2 <- indProd(BLS_PT, var1 = c("bls_CST_AFF_MOsum_6", "bls_CST_CAR_MOsum_6",
  "bls_CST_COM_MOsum_6", "bls_CST_CUD_MOsum_6", "bls_CST_CON_MOsum_6"), var2 = "cntxt_adv", match = FALSE, doubleMC = TRUE)

m1 <- 'f1 =~ bls_CST_AFF_MOsum_6 + bls_CST_CAR_MOsum_6 + bls_CST_COM_MOsum_6 + bls_CST_CUD_MOsum_6 + bls_CST_CON_MOsum_6

f1_cntxt =~ bls_CST_AFF_MOsum_6.cntxt_adv + bls_CST_CAR_MOsum_6.cntxt_adv +
bls_CST_COM_MOsum_6.cntxt_adv + bls_CST_CUD_MOsum_6.cntxt_adv + bls_CST_CON_MOsum_6.cntxt_adv
     
resid_CBCL8 ~ f1 + cntxt_adv + f1_cntxt

# residual covariances
bls_CST_AFF_MOsum_6 ~~ t1*bls_CST_CAR_MOsum_6 + t1*bls_CST_COM_MOsum_6 + t1*bls_CST_CUD_MOsum_6 + t1*bls_CST_CON_MOsum_6
bls_CST_CAR_MOsum_6 ~~ t1*bls_CST_COM_MOsum_6 + t1*bls_CST_CUD_MOsum_6 + t1*bls_CST_CON_MOsum_6
bls_CST_COM_MOsum_6 ~~ t1*bls_CST_CUD_MOsum_6 + t1*bls_CST_CON_MOsum_6
bls_CST_CUD_MOsum_6 ~~ t1*bls_CST_CON_MOsum_6'

fact_m1 <- sem(m1, data=dat2, std.lv=TRUE, ordered=c("bls_CST_AFF_MOsum_6", "bls_CST_CAR_MOsum_6", "bls_CST_COM_MOsum_6", "bls_CST_CUD_MOsum_6",
"bls_CST_CON_MOsum_6"))

summary(fact_m1, fit.measures=TRUE, standardized=TRUE)
parameterEstimates(fact_m1, rsquare=TRUE)

Warning: lavaan WARNING: correlation between variables bls_CST_CON_MOsum_6.cntxt_adv and bls_CST_CON_MOsum_6 is (nearly) 1.0

I don’t really understand how this can happen when I use indProd with doubleMC=TRUE.

Warning: lavaan WARNING: covariance matrix of latent variables is not positive definite; use lavInspect(fit, "cov.lv") to investigate.

> lavInspect(fact_m1, "cov.lv")
              f1  f1_cnt
f1         1.000        
f1_cntxt -24.141   1.000

The model with only resid_CBCL8 ~ f1 shows good fit. My sample size is n=600. Other models with different predictors (f1) but same Y and M result in similar errors/warnings or non-convergence. Any help is greatly appreciated! 

Alex Schoemann

unread,
Jun 22, 2023, 12:35:53 PM6/22/23
to lavaan
There are a couple of issues that might be at play here.

  • I'm not sure about the purpose of the residual covariances in the model. They aren't related to the interaction part of the model, if they're theoretically related  you might try to keep them in but  they also may be causing identification issues.
  • A secondary issue is that your indicators are ordinal for the f1 variable. If you're using a product indicator approach your best bet is to to parcel those indicators, https://doi.org/10.1177/0013164419865017
Alex

Sabrina Twilhaar

unread,
Jun 22, 2023, 3:09:58 PM6/22/23
to lav...@googlegroups.com
Thanks a lot for your prompt and helpful reply, Alex.
  • Regarding the residual covariances, I see that I made a mistake. They should have been estimated between the indicators of the latent interaction (based on what you wrote on p. 327 of your paper, or does that not apply to my case?). Correcting this mistake does not solve the problem though. I still get the same warning that "correlation between variables bls_CST_CON_MOsum_6.cntxt_adv and bls_CST_CON_MOsum_6 is (nearly) 1.0" and the model did not converge.
  • Thank you for pointing me to the possibility of parceling. I will look further into this strategy. Two questions in advance:
    • As my other variable is observed, does that mean that I will have 1 parcel so basically a sum/average score?
    • If so, does that mean that I drop the latent f1 from my model altogether and just test a basic lm with resid_CBCL8  ~ X1(the previous f1) +  cntxt_adv + X1*cntxt_adv ?  
Thank you,
Sabrina

Op do 22 jun 2023 om 18:35 schreef Alex Schoemann <alexander...@gmail.com>:
--
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/nJRe_LyHT6M/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/261a1fc7-606b-4c1c-b377-39007782990bn%40googlegroups.com.

Alex Schoemann

unread,
Jun 27, 2023, 1:59:47 PM6/27/23
to lavaan
  • Regarding the residual covariances, I see that I made a mistake. ...model did not converge. With one indicator of one variable there are no indicators of the latent interaction variable based on the same items, so there should not be any residual covariances estimated.
  • Thank you for pointing me to the possibility of parceling. I will look further into this strategy. Two questions in advance:
    • As my other variable is observed, does that mean that I will have 1 parcel so basically a sum/average score? You could do that, if you want to keep your variable as a latent variable you could also parcel into 2 indicators of the latent variable model. The choice of doing  this depends on the number of responses in your indicators and other parceling concerns. 
    • If so, does that mean that I drop the latent f1 from my model altogether and just test a basic lm with resid_CBCL8  ~ X1(the previous f1) +  cntxt_adv + X1*cntxt_adv ?  Yes, if you parcel to one indicator it is a regression model.
Reply all
Reply to author
Forward
0 new messages