# Implementing ImpliedR in TSSEM

5 posts / 0 new
Offline
Joined: 10/06/2020 - 13:16
Implementing ImpliedR in TSSEM
AttachmentSize
5.9 KB
361 bytes

Hello, I was hoping someone might be able to help with use of the impliedR function in the context of a TSSEM model. I am conducting a 2-stage SEM following the Cheung guide here: https://cran.r-project.org/web/packages/metaSEM/vignettes/Examples.html#two-stage-structural-equation-modeling-tssem

An anonymous peer reviewer commented that: “From the R code, it seems that the a, b, and c path coefficients are directly treated as the correlation coefficients in the analyses. This is wrong! The path coefficient a is the same as that of the correlation. But the other paths (b and c) are different from those of the correlation coefficients. You may use the impliedR function in the metaSEM package to convert path coefficients to correlation matrices. The first example in the help manual shows how to do it for a mediation model.”

I am able to run implied R to convert path coefficients as suggested in the guide (https://rdrr.io/cran/metaSEM/man/impliedR.html):

A1_impliedR <- impliedR(Amatrix = A$values, Smatrix = S) > A1_impliedR Amatrix: Treatment Change.in.sleep.outcome Change.in.DBAS Treatment 0.00 0.00 0 Change.in.sleep.outcome 0.20 0.00 0 Change.in.DBAS 0.24 0.24 0 Smatrix: Treatment Change.in.sleep.outcome Change.in.DBAS Treatment 1 0.00 0.00000 Change.in.sleep.outcome 0 0.96 0.00000 Change.in.DBAS 0 0.00 0.86176 Fmatrix: Treatment Change.in.sleep.outcome Change.in.DBAS Treatment 1 0 0 Change.in.sleep.outcome 0 1 0 Change.in.DBAS 0 0 1 Sigma of the observed variables: Treatment Change.in.sleep.outcome Change.in.DBAS Treatment 1.000 0.200 0.288 Change.in.sleep.outcome 0.200 1.000 0.288 Change.in.DBAS 0.288 0.288 1.000 Sigma of both the observed and latent variables: Treatment Change.in.sleep.outcome Change.in.DBAS Treatment 1.000 0.200 0.288 Change.in.sleep.outcome 0.200 1.000 0.288 Change.in.DBAS 0.288 0.288 1.000 Correlation matrix: TRUE Sigma of the observed variables is positive definite: TRUE Sigma of both the observed and latent variables is positive definite: TRUE Minimum value of the fit function (it should be close to 0 for correlation solution: 0 Status code of the optimization (it should be 0 for correlation solution: 0 But am now wondering how best to incorporate these values into the second stage of my tssem model - is it acceptable to simply substitute values from the 'sigma of the observed variables' matrix into my A matrix for the second stage, like this? ## SUBSTITUTING 'b' and 'c' path estimates A$values[3] <- A1_impliedR$SigmaObs[3] A$values[6] <- A1_impliedR\$SigmaObs[6]

Full code and sample data file attached (impliedR functions added to lines 110-115).

Any advice would be much appreciated! Thank you!

Offline
Joined: 10/08/2009 - 22:37
The a, b, and c path

The a, b, and c path coefficients of your first study are .43, .53, and .31, respectively. You may use the following code to calculate the model implied correlation matrix.

A1 <- matrix(c(0, 0, 0,
0.43, 0, 0,
0.53, 0.31, 0), nrow=3, ncol=3, byrow=TRUE,
dimnames=list(c("x", "m", "y"), c("x", "m", "y")))

S1 <- matrix(c(1, 0, 0,
0, "0.1*ErrVarM",0,
0, 0, "0.1*ErrVarY"), nrow=3, ncol=3,
dimnames=list(c("x", "m", "y"), c("x", "m", "y")))

impliedR(Amatrix=A1, Smatrix=S1)    

Part of the output is

Sigma of the observed variables:
x      m      y
x 1.0000 0.4300 0.6633
m 0.4300 1.0000 0.5379
y 0.6633 0.5379 1.0000

Mike

Offline
Joined: 10/06/2020 - 13:16
Hi Mike, Thanks so much for

Hi Mike, Thanks so much for your reply.

I'm afraid I'm still a little confused. 3 specific questions:
1. In the example above, I see you're calculating an A matrix for an individual study in the meta-analysis. Is this a step I need to complete for every study included?
2. Relatedly, I had previously understood that calculation of an A matrix was only required at stage 2, is it also required as stage 1?
3. I'm unclear on how to implement the output from impliedR into the rest of the model. If I'm running it for every study included for stage 1, do I then substitute values from the 'sigma of the observed variables' table into my data structure for stage 1 analysis?

Many thanks!
Katie

Offline
Joined: 10/08/2009 - 22:37
Hi Katie,

Hi Katie,
From your sample data, my understanding is that you have the path coefficients (a, b, and c) in a mediation model. These path coefficients (except path a) are NOT correlation coefficients. If you want to combine the correlation matrices and fit a mediation model on the average correlation matrix, you need to get the correlation matrices first.

The impliedR() function helps you to get a correlation matrix from the path coefficients (a, b, and c) in each study. After having the correlation matrices, you may proceed to tssem1() and tssem2().

Alternatively, you may meta-analyze the path coefficients (a, b, and c) with a multivariate meta-analysis without using the TSSEM approach (see Cheung & Cheung, 2016 for a comparison on these two approaches).

Cheung, M. W.-L., & Cheung, S. F. (2016). Random-effects models for meta-analytic structural equation modeling: Review, issues, and illustrations. Research Synthesis Methods, 7(2), 140–155. https://doi.org/10.1002/jrsm.1166

Best,
Mike

Offline
Joined: 10/06/2020 - 13:16
Hi Mike,

Hi Mike,

That's very helpful, thanks so much - I understand now!

Best,
Katie