BookmarkSubscribeRSS Feed
braverju
Obsidian | Level 7

Dear Sas experts, 

 

I am trying to confirm unideminsionality using polychoric correlations. I run this code: 

 

PROC CORR DATA=mydata OUTPLC=polyCorr ;
VAR Q1-Q13;
RUN;


PROC CALIS data=polyCorr outstat=ostat;
run;

 

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?

Thank you

Julia

4 REPLIES 4
Rick_SAS
SAS Super FREQ

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"

 

 

braverju
Obsidian | Level 7

Unfortunately, it doesn't seem to be an issue. There are no missing values  (see the attached file) and NOMISS option also doesn't save the problem. 😞

Maybe other ideas?

Rick_SAS
SAS Super FREQ

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" 

Ksharp
Super User

Maybe you need the nearest correlation matrix to instead of your Non positive correlation matrix .

 

http://blogs.sas.com/content/iml/2012/11/28/computing-the-nearest-correlation-matrix.html

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 3168 views
  • 0 likes
  • 3 in conversation