First of all thank you for your hard work over the years to provide us with unique ways to combine meta-analytic principles with SEM--and providing a conduit to do this in R. My research team and I really appreciate it.
I am doing a two stage MASEM with the metaSEM package, and am having some difficulty specifying a mediation analysis in the A/Smatrix. I have four variables: w,x,y,z. And my linear equations are as follows:
X ~ W + e
Z ~ W + e
Y ~ W + X + Z + e
I would like to see if X or Z (or X and Z) mediate the relationship between W and Y.
I specified the Amatrix and Smatrix as follows:
A1 <- mxMatrix("Full", nrow=4, ncol=4, byrow =TRUE, values=c(rep(0,4),1,rep(0,3),1,rep(0,3),1,1,1, 0),
S1 <- mxMatrix(type="Symm",nrow=4,ncol=4,byrow=TRUE,values=c(1, 0, 0, 0, 0, 1, .5, 0, 0,.5, 1, 0, 0, 0, 0, 1),
labels=c("vareth",NA,NA, NA,NA,"varint","covintind", NA, NA, "covintind","varind", NA, NA, NA, NA, "residual"),
Is this the correct way to specify this mediation? I modeled it after the multivariate regression shown on (http://openmx.psyc.virginia.edu/docs/OpenMx/latest/Regression_Matrix.html).
When I run it with tssem2(), my model fit indices are all 0, 1, or Inf.
Thank you so much for your help!