Hi Milke and all,

I'm trying to run a TSSEM to examine the mediation effect for a meta-analysis. However, I'm not sure what's the appropriate way to create the A matrice and S matrice needed for stage 2. Would you please advise?

On your Cheung & Cheung 2014 paper, I saw that the A matrice and S matrice were created manually by typing in the code. Each correlation coefficient was listed in the code. Please see below for an example taken from the supplementary info of that paper. In your introduction of the metaSEM package (see the link below), you have first specified the model via the RAM formulation, you then used lavaan to generate the A and S matrices.

May I know whether I can use the second method to generate the matrices (by specifying a model first)? If not, would you please explain how can I determine 1) the value in weighting the correlation coefficient in the first method and 2) the correct order for the 0 and the weighted correlation coefficient? E.g., If I used the terms incorrectly, I was talking about the 0.2 in the "0.2*b","0.2*c" below.

Thank you for your time and help in advance!

Best wishes,

Iana

Example from Cheung & Cheung 2014 paper:

A1 <- create.mxMatrix(c(0,"0.2*b","0.2*c",

0,0,"0.2*a",

0,0,0),

type="Full", ncol=3, nrow=3, as.mxMatrix=FALSE, byrow=TRUE)

dimnames(A1) <- list(c("LS","JS","JA"), c("LS","JS","JA"))

Example from the introduction of the metaSEM package:

#### Prepare models for stage 2 analysis

model2 <- "## Math is modeled by Spatial and Verbal

Math ~ Spatial2Math*Spatial + Verbal2Math*Verbal

## Variances of predictors are fixed at 1

Spatial ~~ 1*Spatial

Verbal ~~ 1*Verbal

## Correlation between the predictors

Spatial ~~ SpatialCorVerbal*Verbal

## Error variance

Math ~~ ErrorVarMath*Math"

RAM2 <- lavaan2RAM(model2)

Cheung, M.W.-L., and Cheung, S.-F. (2014). Random effects models for meta-analytic structural equation modeling: Review, issues, and illustrations. Manuscript submitted for publication.

Introduction of the metaSEM package

https://cran.r-project.org/web/packages/metaSEM/vignettes/Examples.html#... [6]