Attachment | Size |
---|---|
Model [6] | 142.1 KB |
Hello all,
I am trying to fit a mediation model where each of my main variables (BS, IND, WOB, DUA, BMEET and DIROWN) is mediated by another variable(BNKRISK). I have been following the model following Cheung (2021): Synthesizing Indirect Effects in Mediation Models with Meta-Analytic Methods: Supplementary Materials 2. I will proceed sequentially using to help you to follow the steps and where I encountered the error. This the model is
#Step 1##Mediation Model
model10 <- "PERF ~ c*BS + b*BNKRISK+f*IND+i*WOB+l*DUA+o*BMEET+r*DIROWN+BSIZE+LEV
BNKRISK ~ a*BS
BNKRISK ~ d*IND
BNKRISK ~ g*WOB
BNKRISK ~ j*DUA
BNKRISK ~ m*BMEET
BNKRISK ~ p* DIROWN
BS ~~ 1*BS
IND ~~ 1*IND
WOB ~~ 1*WOB
DUA ~~ 1*DUA
BMEET ~~ 1*BMEET
DIROWN ~~ 1*DIROWN
BSIZE ~~ 1*BSIZE
LEV ~~ 1*LEV
## Define indirect and direct effects
Ind_BS := a*b
Ind_IND := d*b
Ind_WOB := g*b
Ind_DUA := j*b
Ind_BMEET := m*b
Ind_DIROWN := p*b
Dir_BS := c
Dir_IND := f
Dir_WOB := i
Dir_DUA := l
Dir_BMEET := o
Dir_DIROWN := r"
When I plot the model using the syntax below, it is represented as I expect graphically (see the attached)
#Step 2##Display model
plot(model10)
However, when I attempt to fit the tssem, I face the following error, which is from the model I specified. The syntax to fit the model is this:
#Step 3# Convert the lavaan syntax to RAM specification used in metaSEM
RAM1 <- lavaan2RAM(model10, obs.variables= varnames)
RAM1
## Request the likelihood-based confidence interval
tssem.fit <- tssem2(stage1random, RAM=RAM1, intervals.type = "LB",
mx.algebras = list(ind_BS=mxAlgebra(a*b, name="ind_BS"),ind_IND=mxAlgebra(d*b, name="ind_IND"),ind_WOB=mxAlgebra(g*b, name="ind_WOB"),ind_DUA=mxAlgebra(j*b, name="ind_DUA"),ind_BMEET=mxAlgebra(m*b, name="ind_BMEET"),ind_DIROWN=mxAlgebra(p*b, name="ind_DIROWN"),
Dir_BS=mxAlgebra(c, name="Dir_BS"),Dir_IND=mxAlgebra(f, name="Dir_IND"),Dir_WOB=mxAlgebra(i, name="Dir_WOB"),Dir_DUA=mxAlgebra(l, name="Dir_DUA"),Dir_BMEET=mxAlgebra(o, name="Dir_BMEET"),Dir_DIROWN=mxAlgebra(r, name="Dir_DIROWN")))
The error report as :
Error in running the mxModel:
Warning messages:
1: In .solve(x = object$mx.fit@output [7]$calculatedHessian, parameters = my.name) :
Error in solving the Hessian matrix. Generalized inverse is used. The standard errors may not be trustworthy.
2: Unknown reference 'd' detected in the entity 'ind_IND' in model 'TSSEM2 Correlation' .
Can anyone help me with where I specified the model wrongly? Thanks in advance
Regards.