Programming the statistical procedures from SAS

PRINCOMP- PCA

Reply
New Contributor
Posts: 2

PRINCOMP- PCA

Dear All,

While execution of PRINCOMP function in SAS message is coming as follows:

WARNING: The Correlation Matrix is not positive definite.

What is the significance and how to overcome.

Regards

Sougata Das.



Grand Advisor
Posts: 9,452

Re: PRINCOMP- PCA

Maybe some variables have linear correlation relation(multiple colinearity ). Drop some variables. Maybe you should use VARCOMP Procedure to check firstly .
New Contributor
Posts: 2

Re: PRINCOMP- PCA

Dear SIr,

 

   Thanks for reply.

 

I am doing comparison of five samples based on variables (having wide variation in numerical value and different in terms of units). Using only Score and Pattern plot for comparison. The total programme I followed stated below. 

 

******************************************************************************************************************************

data acidification;
input ExperimentNumber $1-5
LagPhase
TimeCurdFormation
pH_FourHour
pH_SixteenHour
RateMaxAcidification
TimeMaxAcidification
pH_MaxAcidification
TimeRangeFastAcidification
pHRangeFastAcidification
;
datalines;
Cntrl 48 253 4.729 4.185 -0.014 106 5.484 72 0.785
Ex-18 39 205 4.618 3.979 -0.018 83 5.617 68 0.948
Ex-20 39 267 4.762 4.127 -0.018 72 5.788 52 0.992
Ex-21 56 305 4.860 4.149 -0.017 91 5.808 58 0.682
Ex-22 42 302 4.837 4.155 -0.016 77 5.881 71 0.793
;
proc print data=acidification;
ods graphics on;
proc princomp data=acidification
Plots (ncomp=2)=pattern;
run;
ods graphics off;
ods graphics on;
proc princomp data=acidification
plots (ncomp=2)=score;
id ExperimentNumber;
run;
ods graphics off;

 

********************************************************************************************************************************************************

 

It is not possible to drop variables for me.

 

VARCOMP - procedures will alow to have plots like score/pattern?

 

Regards

Sougata Das

Grand Advisor
Posts: 9,452

Re: PRINCOMP- PCA

The number of obs is less than the number of variables, That doesn't look right. Your Matrix is singular , maybe that is the reason.

If you transpose them ,you will get rid of these WARRNING, but maybe that is not what you want.

 

data acidification;
input ExperimentNumber $1-5
LagPhase
TimeCurdFormation
pH_FourHour
pH_SixteenHour
RateMaxAcidification
TimeMaxAcidification
pH_MaxAcidification
TimeRangeFastAcidification
pHRangeFastAcidification
;
datalines;
Cntrl 48 253 4.729 4.185 -0.014 106 5.484 72 0.785
Ex-18 39 205 4.618 3.979 -0.018 83 5.617 68 0.948
Ex-20 39 267 4.762 4.127 -0.018 72 5.788 52 0.992
Ex-21 56 305 4.860 4.149 -0.017 91 5.808 58 0.682
Ex-22 42 302 4.837 4.155 -0.016 77 5.881 71 0.793
;
proc transpose data=acidification out=have;
var
LagPhase
TimeCurdFormation
pH_FourHour
pH_SixteenHour
RateMaxAcidification
TimeMaxAcidification
pH_MaxAcidification
TimeRangeFastAcidification
pHRangeFastAcidification;
run;
ods graphics on;
proc princomp data=have
Plots (ncomp=2)=pattern;
run;

proc princomp data=have
plots (ncomp=2)=score;
id _name_;
run;

Check Rick's blog about PRINCOMP.

http://blogs.sas.com/content/iml/2014/11/07/distribution-of-blood-types.html

 

Ask a Question
Discussion stats
  • 3 replies
  • 190 views
  • 2 likes
  • 2 in conversation