Hi,
I have a conceptual question about principal component analysis in SAS as compared to R. In R you must write the syntax PRCOMP to manually standardize the input variables. Does SAS automatically do this for you in the PROC FACTOR procedure?
Thank you
PROC PRINCOMP, by default, standardizes your variables. Or to say it another way, it works from the correlation matrix from your data. You can override this and use the COV option to work from the covariance matrix.
I don't use PROC FACTOR, you should check the documentation, but I believe it is similar.
Thank you for your quick response. This is the code I used:
Proc Factor data= data-set-name
out= data-set-name
nfact=37
simple
method=prin
priors=one
mineigen= 0.99
scree
rotate=varimax
round
flag=.40;
var variables-to-be-analyzed
run;
So even using METHOD=PRIN that will not standardize our variables to make sure I'm understanding you correctly?
According to the PROC FACTOR documentation
COVARIANCE
COVrequests factoring of the covariance matrix instead of the correlation matrix. The COV option is effective only with the METHOD=PRINCIPAL, METHOD=PRINIT, METHOD=ULS, or METHOD=IMAGE option. For other methods, PROC FACTOR produces the same results with or without the COV option.
So if you don't use the COV option, you get the correlation matrix, which is created using standardized variables.
@RebeccaB_ wrote:
Okay, to make sure I'm understanding correctly (I'm pretty much self-taught in PCA) because I specified METHOD=PRIN, and I did not use the COV option, that the input variables are standardized.
Yes
We are using the correlation matrix (which I see in my output) and that is using standardized variables. Is that correct? So I would not need to change my code to make the input variables standardized?
Yes
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.