BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ilikesas
Barite | Level 11

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

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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.

 

View solution in original post

4 REPLIES 4
Reeza
Super User

What does your code look like?

Can we assume you've tried the standard output datasets and they don't have the values? 

Ksharp
Super User
Check this out.

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

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.

 

ilikesas
Barite | Level 11

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 

sas-innovate-2024.png

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.

 

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
  • 1311 views
  • 1 like
  • 4 in conversation