Moderated Mediation in bmlm package (Bayesian multilevel mediation) run through RStan?

Hello,

I am comfortably able to run a Bayesian multilevel mediation model via the bmlm package’s bmlm function which makes it very easy to run (uses RStan interface). However, it does not appear to have the functionality for running a moderated multilevel mediation model. Does anyone have any intuitions about how best to run a moderated multilevel mediation model via bmlm or RStan? My only best guess at this moment is to subset condition 1 and condition 2 of the dichotomous group moderating the mediation and running bmlm for the two groups and compare effects that way. But I’m not sure if that’s the best or most effective way to do a moderated multilevel mediation in RStan or bmlm. Anyone have any thoughts?

1 Like

A moderated mediation model just needs an interaction term on one or more of the paths. Does bmlm let you do that?
E.g., m ~ x*moderator, y ~ x + m. All mediational models are just path models (or SEMs, if latents are involved).

3 Likes

brms will let you run this sort of model.

3 Likes

Should I just do basically what’s seen in this (they have a mediation in brms section)? So models for X --> M, and X + M --> Y except have an interaction term with the grouping factor for every variable?

1 Like