matrixPlot(c(1,1,1))
labels=list(X="X",M=c("M1","M2"),Y="Y")
bmatrix=c(1,1,1,0,0,1)
eq=multipleMediation(labels=labels,bmatrix=bmatrix,mode=1)
drawModel(equation=eq,labels=labels,nodemode=2)
matrixPlot(bmatrix)
bmatrix=c(1,1,0,1,0,0,1,1,1,1)
matrixPlot(c(1,1,0,1,0,0,1,1,1,1))
labels=list(X="X",M=c("M1","M2","M3"),Y="Y")
eq=multipleMediation(labels=labels,bmatrix=bmatrix,mode=1)
drawModel(equation=eq,labels=labels,parallel=TRUE,nodemode=2)
labels=list(X="indep",M=c("med1","med2"),Y="dep")
matrixPlot(c(1,1,1,0,0,1),labels=labels)
Run the code above in your browser using DataLab