Model did not converge

1,511 views
Skip to first unread message

Ainur Amira

unread,
May 18, 2015, 1:59:43 AM5/18/15
to lav...@googlegroups.com

Hi everyone,
I'm the beginner in R and lavaan, Can anyone help me give some suggestion?
I try to run using a small sample size, (let say n=30), but the model only converges at n=55, but when I try using n=76, the model did not converge again. What should I do?


beta <- matrix(NA, nrow = 500, ncol = 4)
FIT <- matrix(NA, nrow = 500, ncol = 7)
var <- matrix(NA, nrow = 500, ncol = 15)
set.seed(12345)
for (i in 1:500){
data2 = data.f(76)

model <- '
KSI1 =~ X1 + X2 + X3
KSI2 =~ X4 + X5 + X6
KSI3 =~ X7 + X8 + X9
KSI4 =~ X10 + X11 + X12
ETA1 =~ Y1 + Y2 + Y3
# REGRESSION
ETA1 ~ KSI1 + KSI2 + KSI3 + KSI4 '
fit <- sem(model=model, data = data2)

beta[i, 1:4] = parameterEstimates (fit, ci = FALSE, standardized = TRUE)[16:19, 4]
FIT[i,1:7] = fitMeasures(fit, c("chisq","GFI", "AGFI", "RMSEA", "NFI", "NNFI", "CFI"))
var[i, 1:15] = parameterEstimates (fit, ci = FALSE, standardized = TRUE)[20:34, 4]
}
WARNING!!!
Error in fitMeasures(fit, c("chisq", "GFI", "AGFI", "RMSEA", "NFI", "NNFI",  : 
  lavaan ERROR: fit measures not available if model did not converge

yrosseel

unread,
May 19, 2015, 2:14:59 AM5/19/15
to lav...@googlegroups.com
On 05/18/2015 07:59 AM, Ainur Amira wrote:
>
> Hi everyone,
> I'm the beginner in R and lavaan, Can anyone help me give some suggestion?
> I try to run using a small sample size, (let say n=30), but the model
> only converges at n=55, but when I try using n=76, the model did not
> converge again. What should I do?

Well, either provide (much) better starting values, or get other/better
data. If your data is too far away from your model, it is not surprising
you get non-convergence, especially with small sample size.

Yves.



Ainur Amira

unread,
May 21, 2015, 2:09:13 AM5/21/15
to lav...@googlegroups.com
Thanks prof for your suggestion =)
Reply all
Reply to author
Forward
0 new messages