Hi,
I have been using proc princomp to perform a principal components analysis. It gave me the eigen vectors, but not the principal components of the original data. Is it possible to transform the original data in order to get the princpal components and later use them in a regression?
Thank you
If you look at the Getting Started example in the PROC PRINCOMP documentation, you will see that
the eigenvectors are listed in the "Eigenvectors" table. They are named Prin1, Prin2, Prin3, etc.
You can use the OUTSTAT= option on the PROC PRINCOMP statement to create an output data set that contains the eigenvectors.
They are listed as the rows that are labeled PRIN1, PRIN2, etc.
If you want to use the PCs in a regression, I believe you want to use the SCORES, which are available in the OUT= data set.
What does your code look like?
Can we assume you've tried the standard output datasets and they don't have the values?
Check this out. http://blogs.sas.com/content/iml/2014/11/07/distribution-of-blood-types.html
If you look at the Getting Started example in the PROC PRINCOMP documentation, you will see that
the eigenvectors are listed in the "Eigenvectors" table. They are named Prin1, Prin2, Prin3, etc.
You can use the OUTSTAT= option on the PROC PRINCOMP statement to create an output data set that contains the eigenvectors.
They are listed as the rows that are labeled PRIN1, PRIN2, etc.
If you want to use the PCs in a regression, I believe you want to use the SCORES, which are available in the OUT= data set.
Thanks Rick, when I added "out = new_data" I obtained a data table which contains the original variables and the newly calculated principal components.
Could I now use these Principal Components in a regression? I have a IML code which does the Principal Components Analysis, but for some reason standardizes the Principal Components - but the PC's that I obtained above are not standardized, so I just want to make sure that these non standardized PCs are the ones that I should use in a regression.
Thanks
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.