Attachment | Size |
---|---|

Question #1 | 309 KB |

Question #2 | 6.58 KB |

#1 error | 118.88 KB |

Hi, Dr. Cheung,

My name is Jane Kim and I'm working on the TSSEM using https://sjak.shinyapps.io/webMASEM/.

# 1.

I attempted to generate the unrestricted average correlation and summary output of fitting a multivariate meta-analysis with the tssem() function of metaSEM. However, an error has occurred. Please help me solve this error.

# 2.

I am not sure how to deal with the missing values. Another dataset using 10 studies has some duplicates in correlations. Do I need to average each correlation?

Thank you so much,

Further, I would like to use the following lavaan syntaxes to see overall mediation model and the indirect effects:

Lavaan Syntax (Overall)

# Regression coefficients

BPN ~ b31*SFM + b32*POM

SWB ~ b43*BPN + b41*SFM + b42*POM

# Covariances

SFM ~~ p21*POM

# Variances

SFM ~~ 1*SFM
POM ~~ 1*POM

BPN ~~ p33

*BPN*

SWB ~~ p44SWB

SWB ~~ p44

Lavaan Syntax (Indirect effects)

INDIRECT EFFECT: POM -> BPN -> SWB

BPN ~ b31*SFM + beta1*POM

SWB ~ beta2*BPN + b41*SFM + b42*POM

INDIRECT EFFECT: SFM -> BPN -> SWB

BPN ~ beta1*SFM + b32*POM

SWB ~ beta2*BPN + b41*SFM + b42*POM

Since it's a Shiny App, please contact the app's author. If you have the R code to reproduce the errors, we may be able to help. Please post the R code and errors.

I will provide the R code and errors soon.

I have one more question on how to code correlation values.

I attempted to aggregate all the subcategories in one variable into one. For example, I put each correlation value of autonomy, belongingness, and competence into one variable, BPN. This led me to duplicate some values in other correlations even in one study. Thus, one study is having several rows with some duplicated values.

In this case, do I need to average the values and have only one row for each study?

This is probably the most common method. However, we have yet to determine the best method for handling non-independent effect sizes.

Find attached data, error, and r code files.

Thank you so much!

It seems that the error is related to the extra NA data.

Thank you so much! I could solve the problem and ended up having 104 data for TSSEM.

However, I faced another problem while producing lavaan syntax for indirect effects for my model.

The model is a sequential mediation model with two mediators. (X: SFM, Y: SWL, M1: BPN, M2, POM)

I could write the syntax for overall analysis:

## Regression coefficients

BPN ~ b21

SFMBPN + b31POM ~ b32

SFMPOM + b42SWB ~ b43

BPN + b41SFM## Variances

SFM ~~ 1

SFMBPNBPN ~~ p22

POM ~~ p33

POMSWBSWB ~~ p44

I would appreciate if you could help me generate syntaxes for three kinds of indirect effects:

1. X->M1->Y

2. X->M2->Y

3. X->M1->M2->Y

The metaSEM package uses a subset of lavaan syntax and RAM specifications. You may refer to the lavaan syntax on how to specify models and functions of parameters, e.g., indirect effects. https://lavaan.ugent.be/tutorial/

Materials for a three-day workshop on MASEM are available at https://github.com/mikewlcheung/masemWorkshop2023. They include many examples. Moreover, examples of published articles are available at https://github.com/mikewlcheung/code-in-articles.

Plus,

Should I include Egger's test (with funnel plot) to provide evidence for publication bias in MASEM?

Yes, you can do it if you want, but please note that tests on publication bias are based on correlation coefficients, whereas MASEM is based on correlation matrices. Results on testing individual correlations may be different from those for correlation matrices.

Thank you so much!

I could solve the initial problem I had with your help.

However, I put the r codes for step 1 and 2, but step 1 analysis is not working. Can you look at the errors and help me solve this error?

ERROR

> ## Stage 1 analysis: find an average correlation matrix

> stage1 <- tssem1(cormatrices, n, method="REM")

> summary(stage1)

Error in update.default(x, warn = FALSE, warn.deprecated = FALSE) :

need an object with call component

It works for me without any errors.

Here are the outputs:

Thank you so much, Dr. Cheung.

I came up with two kinds of lavaan syntax for my serial mediation model, and I am still not sure which one would be accurate. Can you go over my syntax?

X: SFM

M1: BPN

M2: POM

Y: SWB

## Proposed model

model1 <- "

SWB ~ c

SFM + b1BPN + b2POMSFMBPN ~ a1

POM ~ a2

SFM + dBPNSFM ~~ 1

SFMb1## Define direct and indirect effects

Direct := c

Indirect1 := a1

Indirect2 := a2

b2d*b2Indirect3 := a1

Total := c + Indirect1 + Indirect2 + Indirect3

"

model3 <- "

SWB ~ e

SFM + fBPN + cPOMSFMBPN ~ a

POM ~ b

BPNSFMPOM ~ d

## Define indirect and direct effects

Ind_BPNPOM := a

bcInd_BPN := a

fcInd_POM := d

Direct := e"

Please note that

is different from

Another example is:

I suppose you want:

As suggested, you may refer to https://lavaan.ugent.be/tutorial/syntax2.html for the syntax.

Thank you Dr. Cheung,

While copying and pasting the codes, the *s were omitted.

One of the direct paths (a2, IV->M2) and the related indirect path (indirect2, IV->M2->DV) were insignificant in stage 2. However, when I put a categorical moderator (dummy coded, 1=individualism, 0=collectivism), two paths became significant (a1[IV->M1], a2 [IV->M2])

Should the paths be significant in order to proceed with subgroup analysis?

You can find my R codes in the attached file.