![]() ![]() Given these data, this is the model code you want: summary(sem( I simulated some irrelevant data: library(lavaan)ĭat <- as.ame(mvrnorm(5e2, rep(0, 6), matrix(.25, 6, 6) +. I'm aware of how to moderate with 1 input variable, for instance for M1 you'd have something like: M1 ~ a1*X1 + a2*W + a3*X1:W + controlsīut it's unclear to me how one would add the moderators for X2 in these and the other parts of the model. M2 ~ a1prime*X + a2prime*X2 + d*M1 + controls ![]() I've been reading up on Hayes and have figured out the model without the moderator: # direct effect None of the default mediation packages that I've tried so far support such a structure so I'm using lavaan SEM instead. $X$ and $X^2$ are the independent variables.I'm trying to build a SEM that looks like the picture shown below:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |