BookmarkSubscribeRSS Feed
sdhilip
Quartz | Level 8

I am doing PCA analysis in SAS Guide. I have a Pizza dataset which has a brand, ID and 7 variables.

 

Method: 1

 

I am using proc factor and finding the eigenvalue and interpret the result from the rotated factor pattern. The method used: Principal

proc factor data=work.pizza1
method=principal scree mineigen=0 NFACTORS=7 ROTATE=varimax REORDER OUT=PIZZA1;
var mois--cal;
run;

Result:

Eigen value - factor.PNGrotated factor pattern.PNG

I reduced three variables from the rotated factor pattern.

 

Method: 2

 

I am using proc princomp.

 

proc princomp data=work.pizza1 out=new;
var mois--cal;
run;

 

I am getting eigen value same for both the methods as it is derived from the correlation matrix. However, value is different for rotated factor pattern and eigen vector .

 

Result:

 

Eigen value - PCA.PNGEIGEN VECTOR.PNG

 

My question:

 

1) What is the difference between princomp vs proc factor while using PCA analysis?

2) I am interpreting the result from rotated factor pattern in proc factor. How to interpret the result from princomp? Should I use eigenvector to interpret the result? If so, it shows a different one compared to proc factor.

3) Are the results same if I run both factor and princomp?

4) How to use the method in princomp? Here, I used varimax. 

 

I attached the output and sas code.

 

Please advise.

 

 

 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

The difference is that you asked PROC FACTOR to rotate the components. The PROC PRINCOMP output does not rotate the components.

--
Paige Miller
sdhilip
Quartz | Level 8

Thanks @PaigeMiller  Which result should I take proc factor are princomp? Which one should I go if I asked to do a PCA analysis? Please advise.

PaigeMiller
Diamond | Level 26

There is no possible answer to this without a lot more information about the goals of the analysis. Rotated or unrotated components both have usefulness, depending on what you are trying to do with the components.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1796 views
  • 4 likes
  • 2 in conversation