Hi,
R newbie here!
I want to run a moderated mediation in R.
I have a continuous predictor, a continuous mediator and a continuous outcome. My moderator is categorical with 2 levels.
I know how to set mediation terms using lavaans but I'm not sure how to incorporate the moderator. Also, all examples tell me to grand mean centre the predictor, moderator and mediator but I can't grand mean centre my moderator because it is categorical.
here is how my mediation model would look using lavaans (i have named variables by their theoretical function for ease) :
med_mod <- 'outcome ~ c * predictor + b * mediator
mediator ~ a*predictor
indirect effect := a*b
total effect := c + (a*b) '
can anyone help and show me how I can adapt this to include the potential moderating effects of a categorical variable with 2 levels?
Thank you very much for your help <3