03-17-2016 01:47 PM
Dear Sas experts,
I am trying to confirm unideminsionality using polychoric correlations. I run this code:
PROC CORR DATA=mydata OUTPLC=polyCorr ;
PROC CALIS data=polyCorr outstat=ostat;
The polyCorr file looks normal to me. But get the following error message:
ERROR: The sample covariance or correlation matrix is not positive definite. ML or GLS estimates cannot be computed.
Can anybody help?
03-17-2016 02:06 PM
The most likely explanation is that your data contain missing values. By default PROC CORR computes pairwise correlations. Be sure to specify the NOMISS option on the PROC CORR statement, which will tell the procedure to perform listwise deletion of observations with missing values, which always results in valid correlation matrix. For details, see "Missing values and pairwise correlations: A cautionary example"
03-17-2016 02:33 PM
03-17-2016 03:32 PM
Maybe not, but the root cause is the same: PROC FREQ is producing an estimate for a matrix that should (in theory) be SPD, but the estimate is created in a pairwise fashion, so the estimate is not necessarily SPD.
You can try to use more iterations or a tighter convergence criterion by using POLYCHORIC(converge=1e-6 maxiter=500), but I'm not confident that it will work.
From what I've read, if you have categorical variables with fewer than about 5 categories, the polychoric approximation (which uses assumes bivariate normality) just isn't very reliable. For more about non-PD matrices, including a section on polychoric matrices, see "Not Positive-Definite Matrices -- Causes and Cures"
03-17-2016 10:31 PM
Maybe you need the nearest correlation matrix to instead of your Non positive correlation matrix .