Moderation, moderated mediation

276 views
Skip to first unread message

Gokay Kirtil

unread,
Jul 23, 2022, 5:11:09 PM7/23/22
to blavaan
Hi all !

I would like to ask that if anyone has experienced a moderated mediation model. I'm just trying to improve my modelling skills and I got some questions in my mind :

1- should I prefer a categorical or a continuous moderator variable when the other variables are continuous (which one works well under bayesian sem, after I collect the real data I don't want to see that my variable doesnt work-converge well)
2- for conducting moderation effect, as Marsh et al (2004) advises, I'm centering the relevant moderation variables and then  I prefer 'matched pairs' method and choosing the best items for interaction and ignoring the others , then  those variables are being multiplied like (a1*b2 + a2*b4 ..) and these interactions are being added to the model regression.. Is this way a safe and sound way to test the moderation effects or are there better approaches that we can conduct in blavaan ?

by the way I'm mostly dealing with likert type scales and variables are first order latent variables..

for those who are interested, these are the sources I benefited  a lot, because there is limited info. regarding moderated mediation models with lavaan and blavaan ..
(2) - Structural Equation Models of Latent Interactions: Evaluation of Alternative Estimation Strategies and Indicator Construction (Marsh, Wen, Hau - 2004)

Mauricio Garnier-Villarreal

unread,
Jul 25, 2022, 5:57:39 AM7/25/22
to blavaan
Hi

If you use manifest variables, and the moderator is categorical, it might be better to do the analysis as multiple group, as that would give you full information of the change in relations per category group.
If the moderator is continuous, then the interaction approach is the best.

If you use latent factors as moderators, the method I recommend is the indicator product approach, you can use the function indProd() from semTools to create the indicator interaction terms. You can see the help of the function has examples on how to apply them with lavaan, the same approach applies with blavaan.
As you mentioned, the main 2 methods are mean center, or residual center. Between these 2, I havent seen substantial differences, might want to check if one of them is more applicable to your case
A modeling difference is that when using residual centering, the interaction factor needs to be uncorrelated to the other factors, while the mean center one does needs to be correlated

Estimation wise, I dont see a reason for either of these approaches to have convergence issues with MCMC


Marsh, H. W., Wen, Z. & Hau, K. T. (2004). Structural equation models of latent interactions: Evaluation of alternative estimation strategies and indicator construction. Psychological Methods, 9(3), 275–300. doi: 10.1037/1082-989X.9.3.275

Lin, G. C., Wen, Z., Marsh, H. W., & Lin, H. S. (2010). Structural equation models of latent interactions: Clarification of orthogonalizing and double-mean-centering strategies. Structural Equation Modeling, 17(3), 374–391. doi: 10.1080/10705511.2010.488999

Little, T. D., Bovaird, J. A., & Widaman, K. F. (2006). On the merits of orthogonalizing powered and product terms: Implications for modeling interactions among latent variables. Structural Equation Modeling, 13(4), 497–519. doi: 10.1207/s15328007sem1304_1

Gokay Kirtil

unread,
Jul 28, 2022, 4:45:58 AM7/28/22
to blavaan
Thank you Dr. for the exploratory info !

25 Temmuz 2022 Pazartesi tarihinde saat 12:57:39 UTC+3 itibarıyla mauga...@gmail.com şunları yazdı:

Gokay Kirtil

unread,
Jul 29, 2022, 5:09:54 AM7/29/22
to blavaan
Dear Dr. Garnier-Villarreal,

I couldnt find some useful info about, is it recommended to report slope-plots graphs if we'r conducting a bayesian moderation, just as it's common to report in frequentist way, and if so what would you kindly advise in order to withdraw graph plots from blavaan ? there are some codes in the internet that're trying to withdraw from lavaan via ggplot but they're complicated and hard to implement ..

Sincerely, 

25 Temmuz 2022 Pazartesi tarihinde saat 12:57:39 UTC+3 itibarıyla mauga...@gmail.com şunları yazdı:
Hi

Mauricio Garnier-Villarreal

unread,
Jul 29, 2022, 8:14:47 AM7/29/22
to blavaan

You mean the simple slopes? Yes, it would be recommended to still present this, as part of moderation analysis, this indicates "how" does the factors moderate their relations

semTools have several functions to plot these relations. But I think they dont work with blavaan objects yet. You need to modfied the functions to work with blavaan. I am attaching a previous version of the 2 way residual centering method. This should work with your blavaan object, but notice this is for when you use the residual centering approach, if you use the mean centering it needs to use the other function

PS: I will make a note to edit these function in semTools to work with blavaan objects in the next update
probe2WAY_helpfunctions.R

Gokay Kirtil

unread,
Aug 2, 2022, 2:02:26 PM8/2/22
to blavaan
Dear Dr.,
Thanks for the reply. As an  enthusiastic rookie, I immediately started to work on semtools: inprod function. First of all, I'm trying to fit the Sem models in lavaan, after that I conduct a non-informative Bayesian Sem and try to catch the similar results, and mostly I do. Inprod's residual centering gave the best results for my demo.

I don't want to take your time but I'd be appreciated if you may have a quick look at the codes. In here all variables are first-order latent variables and I'm trying to observe this moderated mediation sem. (Cid variable is the moderator, and Kac is the dependent one; you may see on the pic.). I just put the necessary ones not to busy you, and this model works good for both lavaan & blavaan.

The plotprobe command gives the simple slope clearly in lavaan, I just wanted to try it out for blavaan and it gives the same graph, but a little broken =)
As you said, that would be great if you may add this feature in the next update, so blavaan 'll be ready for moderations  ! thanks in advance !

Gokay
29 Temmuz 2022 Cuma tarihinde saat 15:14:47 UTC+3 itibarıyla mauga...@gmail.com şunları yazdı:
bsem code.txt
moderation bsem.jpg
bsem model.jpg

Mauricio Garnier-Villarreal

unread,
Aug 2, 2022, 4:10:38 PM8/2/22
to blavaan
Gokay

In a quick look, I think it is mostly corect. Just one edit to the model. Since you are using residual centering, the interaction factor has to have the coarvaices fixed to 0 with the factors that formed it

CidByGelr ~~ 0*Cid
CidByGelr ~~ 0*Gelr

If the plotprobe works with the blavaan object, be aware that it is useing the delta method. Treating the posterior means as estimates, and the SD as the SE. So defining the SE of the simple slopes based on the normal assumption
You can use the legendArgsargument to modifiy the legend, like location etc
Reply all
Reply to author
Forward
0 new messages