ecmerkle/blavaan

Bug with multiple groups

maugavilla opened this issue · 1 comments

It seems the latest version crashes when I add labels or equality constraints in a multiple group model. Without constraints it works well, but when I add things like weak invariance constraints I get this

This only happens with std.lv=T , with std.lv=F it runs fine

mod2 <- '
Positive =~ c(l1,l1)*PosAFF1 + c(l2,l2)*PosAFF2 + c(l3,l3)*PosAFF3
Agency =~ c(l4,l4)*Agency1 + c(l5,l5)*Agency2 + c(l6,l6)*Agency3

Positive ~~ c(1, NA)*Positive
Agency ~~ c(1, NA)*Agency
            '

> fit2_stan <-  bcfa(mod2, data=dat, std.lv=T, 
+               group="Gender",
+               n.chains = 3, burnin=5000,
+               sample=1000, target="stan", meanstructure=T)
[1] "Error in lamsign[l1, 1] : subscript out of bounds\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<subscriptOutOfBoundsError in lamsign[l1, 1]: subscript out of bounds>
Error in blavaan(mod2, data = dat, std.lv = T, group = "Gender", meanstructure = T,  : 
  blavaan ERROR: problem with translation from lavaan to MCMC syntax.

Thanks, I will look at this soon. (And I edited your comment because the code was not displaying correctly on the github website.)