I am running a factor analysis via psych package.
cormat <- polychoric(na.omit(mself1))
##Warning message:
In cor.smooth(mat) : Matrix was not positive definite, smoothing was done
fa(cormat,nfactors=3,n.obs = 183 ,n.iter=1, rotate="oblimin",fm="ml")
## Error in if (dim(r)[1] == dim(r)[2]) { : argument is of length zero
I just wondered why the argument is of length zero which means the file is empty, when I type cormat the Polychoric matrix came out.
How could I fix this problem, or it has anything with the "not positive definite"?
Thanks!