You are here

Paths appear to be fixed to 1.000 when fitting the structural model in Stage 2.

6 posts / 0 new
Last post
Nicola's picture
Offline
Joined: 11/15/2013 - 16:06
Paths appear to be fixed to 1.000 when fitting the structural model in Stage 2.
AttachmentSize
File EUBIUdata.dat244 bytes
Binary Data EUBIU.R2.95 KB
File PUEUBIdata.dat424 bytes
Binary Data PUEUBI.R4.18 KB

Dr. Mike,

I am running multiple structural models and appear to have the same issue with all the models. In each of the outputs the certain paths appear to be fixed to 1.0 and another value.

For instance in the structural model, EU -> BI -> U (files EUBIU.dat & EUBIU.R), the paths from EU -> BI = 1 and the path from BI -> U = 1.

Another model (files PUEUBI.data & PUEUBI.R), the paths EU -> PU = 1.0, while the paths from EU -> BI and PU -> BI are both equal to 1.0.

I think I may be constraining these paths to be either equal to 1.0 or equal to each other.

I have attached the syntax and data sets I used for your convenience . The syntax is modified from Cheung (2013) metaSEM: An R Package for Meta-Analysis using Structural Equation Modeling. Any assistance is greatly appreciated.

Thanks,
Nicola

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Hi Nicola, I think that you

Hi Nicola,

I think that you have incorrectly introduced the latent variables in the model. In the example of EUBIU, the A matrix is:
x1 x2 x3 Alpha Beta
x1 "0" "0" "0" "1Alpha_x1" "0"
x2 "0" "0" "0" "0" "1
Alpha_x2"
x3 "0" "0" "0" "0" "0"
Alpha "0" "0" "0" "0" "0"
Beta "0" "0" "0" "0" "0"

and the S matrix is:
x1 x2 x3 Alpha Beta
x1 ".3e1" "0" "0" "0" "0"
x2 "0" ".3
e2" "0" "0" "0"
x3 "0" "0" ".3*e3" "0" "0"
Alpha "0" "0" "0" "1" "0"
Beta "0" "0" "0" "0" "1"

The model is not identified as there is only one indicator per factor and x3 is not loaded in any factor.

If your model is x1 -> x2 -> x3 (without the direct effect from x1 to x3), the following syntax works for me:
A2 <- matrix(c(0,0,0,
"0x1tox2",0,0,
0,"0
x2tox3",0),
nrow=3, ncol=3, byrow=TRUE)
dimnames(A2) <- list(c("x1", "x2", "x3"), c("x1", "x2", "x3"))
A2
A2 <- as.mxMatrix(A2)

S2 <- Diag(c(1,"0.2Varx2","0.2Varx3"))
dimnames(S2) <- list(c("x1", "x2", "x3"), c("x1", "x2", "x3"))
S2
S2 <- as.mxMatrix(S2)

diag.constraint=TRUE is required since there is a mediator (x2)

random2 <- tssem2(random1, Amatrix = A2, Smatrix = S2, diag.constraint=TRUE, intervals.type="LB")
summary(random2)

Hope it helps.

Mike

Nicola's picture
Offline
Joined: 11/15/2013 - 16:06
Syntax for matrix A and S

Dr. Mike,

Thank you for responding. Your feedback was most helpful. I see how I introduced the latent variables inappropriately. The model I intended to run is x1 -> x2 -> x3 (without the direct effect from x1 to x3), as you stated. I ran the model using the syntax your provided and it worked for me as well. Thank you again for your feedback.

In the case of PUEUBIdata, the model is x1 -> x3, x2 -> x3, and x2 -> x1 (I've attached a figure for your convenience.) Would the syntax then be the following:

A2 <- matrix(c(0,"0x2tox1",0,0,0,0,"0x1tox3","0*x2tox3",0),nrow=3, ncol=3, byrow=TRUE)
dimnames(A2) <- list(c("x1", "x2", "x3"), c("x1", "x2", "x3"))
A2
A2 <- as.mxMatrix(A2)

S2 <- Diag(c("0.2Varx1",1,"0.2Varx3"))
dimnames(S2) <- list(c("x1", "x2", "x3"), c("x1", "x2", "x3"))
S2
S2 <- as.mxMatrix(S2)

Thanks again for your consideration and feedback,
Nicola

Mike Cheung's picture
Offline
Joined: 10/08/2009 - 22:37
Hi, Nicola. It seems correct.

Hi, Nicola.

It seems correct. When you are fitting the model, please make sure to include the diag.constraints=TRUE in tssem2().

Cheers,
Mike

neale's picture
Offline
Joined: 07/31/2009 - 15:14
Model specification problem?

Hi Nicola

I'm not sure I'm the Dr. Mike you were looking for, but perhaps I can help anyway. I took a look at this and note that a) MetaSEM is pretty cool, and b) there seems to be something a bit odd about the model.

MetaSEM puts the model, both fitted and not, into its output, from which we can explore the objects in the model, particularly the A, S and F matrices, and what they generate in the way of expected covariances. It seems that the variance of the third variable ends up at zero. So I don't think the problem is that the parameters are fixed, but that there is a model specification issue such that the parameters don't have any effect on the fit of the model. Note also the IFAIL code of 6 which indicates an issue with identification. Nothing in the A matrix affects variable 3 (3rd row all zero). The S matrix for element 3,3 is also zero. So you end up with zero variance for variable 3, and zero covariance with anything else. Using mxEval() to compute the expected covariance matrix, and then back tracing the individual matrices, we get:

> mxEval(Fmatrix %&% (solve(Id - Amatrix) %&% Smatrix), fixed2.cluster$Self$mx.fit)
          [,1]      [,2] [,3]
[1,] 0.3860283 0.3860283    0
[2,] 0.3860283 1.3860283    0
[3,] 0.0000000 0.0000000    0
> mxEval(Fmatrix, fixed2.cluster$Self$mx.fit)
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    0    0    0    0
[2,]    0    1    0    0    0
[3,]    0    0    1    0    0
> mxEval(Amatrix, fixed2.cluster$Self$mx.fit)
     [,1] [,2] [,3] [,4]      [,5]
[1,]    0    0    0    0 0.6213117
[2,]    0    0    0    1 0.6213117
[3,]    0    0    0    0 0.0000000
[4,]    0    0    0    0 0.0000000
[5,]    0    0    0    0 0.0000000
> mxEval(Smatrix, fixed2.cluster$Self$mx.fit)
     [,1] [,2] [,3] [,4] [,5]
[1,]    0    0    0    0    0
[2,]    0    0    0    0    0
[3,]    0    0    0    0    0
[4,]    0    0    0    1    0
[5,]    0    0    0    0    1
> mxEval(solve(Id - Amatrix), fixed2.cluster$Self$mx.fit)
     [,1] [,2] [,3] [,4]      [,5]
[1,]    1    0    0    0 0.6213117
[2,]    0    1    0    1 0.6213117
[3,]    0    0    1    0 0.0000000
[4,]    0    0    0    1 0.0000000
[5,]    0    0    0    0 1.0000000
> mxEval(solve(Id - Amatrix) %&% Smatrix, fixed2.cluster$Self$mx.fit)
          [,1]      [,2] [,3] [,4]      [,5]
[1,] 0.3860283 0.3860283    0    0 0.6213117
[2,] 0.3860283 1.3860283    0    1 0.6213117
[3,] 0.0000000 0.0000000    0    0 0.0000000
[4,] 0.0000000 1.0000000    0    1 0.0000000
[5,] 0.6213117 0.6213117    0    0 1.0000000
Nicola's picture
Offline
Joined: 11/15/2013 - 16:06
Model specification issue

Hi Neale,

Thank you for your response. I agree MetaSEM is cool! Thank you for pointing out the model specification issue and showing me how to compute the expected covariance matrix. Your feedback is helpful.

Best regards,
Nicola