Closed lf-araujo closed 2 years ago
I think the Lavaan syntax you are using implicitly fixes parameters when, e.g., 1*X1 is used. Changing the code to the following at least freed up some of the elements of m1@matrices$A@free - which are correctly loaded into Afree.
library(umx)
model <- "
xir =~ X1 + X2 + X3 + X4 yir =~ 1Y1 + 1Y2 + 1Y3 + 1Y4
Y2 ~ 0.1X1 X2 ~ 0.5Y1 Y3 ~ 0.1X2 X3 ~ 0.5Y2 Y4 ~ 0.1X3 X4 ~ 0.5Y3
X1 + X2 + X3 + X4 ~ 0.05PGSx Y1 + Y2 + Y3 + Y4 ~ 0.1PGSy
innoX1 =~ 1X1 innoX2 =~ 1X2 innoX3 =~ 1X3 innoX4 =~1X4 innoY1 =~1Y1 innoY2 =~1Y2 innoY3 =~1Y3 innoY4 =~1Y4
X2 ~ innoX1 X3 ~ innoX2 X4 ~ innoX3 Y2 ~ innoY1 Y3 ~ innoY2 Y4 ~ innoY3
xir ~~ 0.5*yir
X1 ~ 1 X2 ~ 1 X3 ~ 1 X4 ~ 1 Y1 ~ 1 Y2 ~ 1 Y3 ~ 1 Y4 ~ 1
innoX1 ~~ 1innoX1 innoX2 ~~ 1innoX2 innoX3 ~~ 1innoX3 innoX4 ~~ 1innoX4 innoY1 ~~ 1innoY1 innoY2 ~~ 1innoY2 innoY3 ~~ 1innoY3 innoY4 ~~ 1innoY4 "
And I note that code and /code (inside less-than and greater-than chevrons) gets weirdly formatted on github.
Thanks, ok, not a bug. The lavaan switch is not compatible with setting starting values with the 0.0*var syntax.
Edit For future reference in case other users come across this. The syntax start(0.3)*var seems to set the starting value whilst keeping the parameter free to be estimated.
Dear Tim,
I came across a strange behaviour while trying to convert a lavaan model to RAM. In the model specification:
Now when we look at the A matrix free values:
It is all set to FALSE, when in fact it should look more like the following, no?
With TRUE in the paths specified to be estimated.