Warning message: In cov2cor(w.cov) : diag(.) had 0 or NA entries; non-finite result is doubtful

3,223 views
Skip to first unread message

franz...@gmail.com

unread,
May 9, 2018, 5:42:54 AM5/9/18
to lavaan
Hello,

I tried to create the pooled within groups covariance matrix for a CFA using this function:
ml.s.change <- mcfa.input("Vkst", s.change)

Unfortunately, r shows this "Warning message: In cov2cor(w.cov) :   diag(.) had 0 or NA entries; non-finite result is doubtful" afterwards.
However, it is possible to fit a model. So I am a bit confused: what does the message mean? Can I trust the fit measures r displays when I fit the pw-matrix with my CFA?
And most important: how can I get rid of the message?

Thanks in advance!!!

All the best,
Franzi

Terrence Jorgensen

unread,
May 12, 2018, 4:28:40 AM5/12/18
to lavaan
I tried to create the pooled within groups covariance matrix for a CFA using this function:
ml.s.change <- mcfa.input("Vkst", s.change)

I had to use Google to figure out that you were using a function (which is not part of the lavaan package) from this article:


Did you know that the development version of lavaan can handle some simple cases of multilevel SEM?  Only 2 levels, continuous data, random intercepts (sufficient for multilevel CFA).  No random slopes, categorical data, or missing data.  Maybe lavaan provides what you need now, so you don't need this article's ad-hoc solution?



Unfortunately, r shows this "Warning message: In cov2cor(w.cov) :   diag(.) had 0 or NA entries; non-finite result is doubtful" afterwards.
However, it is possible to fit a model. So I am a bit confused: what does the message mean?

A correlation is a standardized covariance.  You standardize the covariance between X and Y by dividing it by the SD of X and the SD of Y.  If the diagonal of the covariance matrix (i.e., the variances) includes a 0 or NA, then you cannot get a correlation because you cannot divide by zero (or NA, which is R's missing-data code).
 
Can I trust the fit measures r displays when I fit the pw-matrix with my CFA?

I don't know anything about Huang's ad-hoc solution.  Perhaps you can email him directly, since he is the author of that software.

And most important: how can I get rid of the message?
 
Instead of loading the source code from the article, trying actually stepping through it to see why the error occurs:


Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages