turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- obtaining the principal components from proc princ...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-08-2017 10:06 PM

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

Accepted Solutions

Solution

03-11-2017
07:19 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ilikesas

03-09-2017 05:42 AM

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.

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ilikesas

03-08-2017 11:01 PM

What does your code look like?

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ilikesas

03-08-2017 11:28 PM

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

Solution

03-11-2017
07:19 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ilikesas

03-09-2017 05:42 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

03-09-2017 10:32 PM

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