Mediation analysis

Posted on
No user picture. jode Joined: 08/21/2015
Forums

Hi,
I would like to perform a mediation analysis by defining the indirect effects with mx.algebras in the wls() funktion.
I tried mx.algebras= list( ind=mxAlgebra(b410*b14, name="ind"))), where b410 and b14 refer to the paths in the A matrix. However, I get the following error in the analysis:

Error in running the mxModel:

Error in wls(Cov = R, asyCov = acov, n = n, Smatrix = S, Amatrix = A, :
object 'out' not found
In addition: Warning message:
In runHelper(model, frontendStart, intervals, silent, suppressWarnings, :
SLSQP: Failed due to singular matrix E or C in LSQ subproblem or rank-deficient equality constraint subproblem or positive directional derivative in line search

What I am doing wrong?
Looking forward to your help. Thanks!

Replied on Thu, 10/01/2015 - 06:57
Picture of user. Mike Cheung Joined: 10/08/2009

In reply to by jode

Hi, Johannes.

I have identified two issues: (1) the variances of the independent variables are not fixed at 1; and (2) some of the independent variables are not correlated.

Based on your A matrix, I have modified the S matrix. Attached are the results. Hope it helps.

Mike

Replied on Thu, 10/01/2015 - 12:27
No user picture. jode Joined: 08/21/2015

In reply to by jode

I just saw that you specified in the S matrix ".3*cor106" and ".3*cor116" twice. Was that intendet?
When I change it to ".3*cor106" and ".3*cor107" and ".3*cor116" and ".3*cor11t" I have a model with df = 0. Then I cannot check my model fit right? Therefore, I would leave some correlations out that also make not really sense from a theoretical perspective?

Replied on Fri, 10/02/2015 - 23:49
Picture of user. Mike Cheung Joined: 10/08/2009

In reply to by jode

The models should be specified based on your theories (hypotheses). If your theories hypothesize that all the association among the dependent variables can be explained by the independent variables, the residuals should be uncorrelated; otherwise, they can be correlated.

Mike