Closed b1azk0 closed 4 years ago
Dear Blazej Mroinski,
I have updated my processR package to 0.2.2.2.
Please install the latest version from Github:
devtools::install_github("cardiomoon/processR")
The following R codes makes your model.
require(processR)
require(lavaan)
labels=list(X="cond",M=c("import","pmi"),Y="reaction")
moderator=list(name="gender",matrix=list(c(0,0,0,0,0,1)))
covar=list(name="age",site=list(c("M1","M2","Y")))
drawConcept(labels=labels,moderator=moderator,covar=covar,parallel=TRUE,
node.pos = list(C1=c(1,0.9),W=c(0.9,0)))
drawModel(labels=labels,moderator=moderator,covar=covar,parallel=TRUE,
node.pos = list(C1=c(1,0.9),W=c(1,0),`M2:W`=c(0.8,0)))
modelsSummaryTable(labels=labels,moderator=moderator,covar=covar,data=pmi)
model=multipleMediation(labels=labels,moderator=moderator,covar=covar,data=pmi,
rangemode=2)
cat(model)
semfit=sem(model=model,data=pmi,se="boot")
summary(semfit)
medSummaryTable(semfit)
modmedSummaryTable(semfit)
conditionalEffectPlot(semfit,data=pmi,no=2)
drawModel(semfit,labels=labels,moderator=moderator,covar=covar,data=pmi,parallel=TRUE,
node.pos = list(C1=c(1,0.9),W=c(1,0),`M2:W`=c(0.8,0)),whatLabel="est",
arrow.pos = list(b3=0.3,g=0.3))
Thank you very much! Your code works like a charm and explains a lot. Best regards Blazej
Dear Prof. Moon,
I was struggling in setting up simple slopes for a variation of Hayes model 14 with two mediators operating in parallel:
I was trying to join code coming from:
With this:
Problems I had with the above are:
I don't know how to moderate path
b2
from my diagram, as replacinga
frommoderator=list...
tob
gives an errorI can't successfully add the covariate
I don't know how to code properly the conditional inderect effect of
a2*b2
and how to add simple slopes.Could you please help me out with this?