<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Correlation between original variables and PCA? in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655531#M5145</link>
    <description>&lt;P&gt;Run proc contents on your data set and double check the spelling of your variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have been seeing variable labels of Prin1 which is not necessarily the Name of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is also a chance that when creating the data set used an existing variable was dropped or renamed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If SAS says variable XXXXX does not exist, it doesn't exist as spelled with that name.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jun 2020 13:58:51 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-06-09T13:58:51Z</dc:date>
    <item>
      <title>Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655521#M5143</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code im using is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* what are the correlations between PCs and orig vars? */&lt;BR /&gt;proc corr data= work.ass2_drugbankdata noprob nosimple;&lt;BR /&gt;var MW LogP LogD Hdonors Hacceptors PSA ROT NATOM NRING ;&lt;BR /&gt;with Prin1- Prin9;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant run this due to an&amp;nbsp; error:-&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: Variable PRIN1 not found.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This doesn't&amp;nbsp;make sense as the Principal components are named Prin1 - Prin9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can somene shed some light on what could be going on here ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 13:38:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655521#M5143</guid>
      <dc:creator>axelpuri</dc:creator>
      <dc:date>2020-06-09T13:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655530#M5144</link>
      <description>&lt;P&gt;Show us PROC CONTENTS of the data set&amp;nbsp;&lt;SPAN&gt;work.ass2_drugbankdata&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 13:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655530#M5144</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-09T13:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655531#M5145</link>
      <description>&lt;P&gt;Run proc contents on your data set and double check the spelling of your variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have been seeing variable labels of Prin1 which is not necessarily the Name of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is also a chance that when creating the data set used an existing variable was dropped or renamed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If SAS says variable XXXXX does not exist, it doesn't exist as spelled with that name.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 13:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655531#M5145</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-09T13:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655535#M5146</link>
      <description>&lt;P&gt;Also, there is a mathematical formula for the correlation between the original variable and the i-th value of the j-th principal component vector, which is given here:&amp;nbsp;&lt;A href="https://stats.stackexchange.com/questions/253718/correlation-between-an-original-variable-and-a-principal-component" target="_blank" rel="noopener"&gt;https://stats.stackexchange.com/questions/253718/correlation-between-an-original-variable-and-a-principal-component&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which means (to me) that you don't really have to compute the correlations between original variables and principal components, because the absolute values of the eigenvector determine which are the variables that are most highly correlated in each dimension (at least in the case where you are using the default PRINCOMP input, which is to use the correlation matrix).&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 14:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655535#M5146</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-09T14:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655544#M5147</link>
      <description>&lt;P&gt;Can i post a picture or do i need to follow some protocol code like creating a minimum reproducible example?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 14:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655544#M5147</guid>
      <dc:creator>axelpuri</dc:creator>
      <dc:date>2020-06-09T14:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655561#M5148</link>
      <description>&lt;P&gt;We'd need a screen capture of the entire PROC CONTENTS output, or better yet the text equivalent from the LISTING window, pasted into your reply using the &amp;lt;/&amp;gt; icon .&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 15:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655561#M5148</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-09T15:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655562#M5149</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332033"&gt;@axelpuri&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can i post a picture or do i need to follow some protocol code like creating a minimum reproducible example?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For proc contents output Listing or any output that will format here is fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data is preferred to be data step code. Data step does not run into cross operating system issue or generally language options. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as &lt;STRONG&gt;text&lt;/STRONG&gt; to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 15:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655562#M5149</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-09T15:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655564#M5150</link>
      <description>&lt;P&gt;By the way,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332033"&gt;@axelpuri&lt;/a&gt;&amp;nbsp;, if you look at the contents of the data set and PRIN1 is not in there, then I think we don't need to see the results.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 15:46:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655564#M5150</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-09T15:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655787#M5151</link>
      <description>&lt;P&gt;Prin1 is the principal component 1 . I need a correlation table for the original variables with the PCs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cant do that using the component pattern profile plot as there are 9 variables and hence 9 PCs and it looooks really cluttered&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further i could have gleaned more information from the component plots but i dont get the all plots for all the different combinations of PCS and&amp;nbsp; variables&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only option left now is to get the correlations in a tabular format but i cant seem to run the code because of&amp;nbsp; the error for Prin1 when its clearly a PC as you can see from the eigenvectors table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look forward to hearnig from you !! Kind Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 03:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655787#M5151</guid>
      <dc:creator>axelpuri</dc:creator>
      <dc:date>2020-06-10T03:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655788#M5152</link>
      <description>Btw i was able to get the table just now&lt;BR /&gt;What i dont understand is why didn't i have to enter my data as work.mydatasetname in the data= ... part ?&lt;BR /&gt;/* what are the correlations between PCs and orig vars? */&lt;BR /&gt;proc corr data=PCOUT noprob nosimple;&lt;BR /&gt;var MW LogP LogD Hdonors Hacceptors PSA ROT NATOM NRING;&lt;BR /&gt;with Prin1-Prin9;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;What does PCout mean ?&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Jun 2020 03:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/655788#M5152</guid>
      <dc:creator>axelpuri</dc:creator>
      <dc:date>2020-06-10T03:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/656071#M5153</link>
      <description>&lt;P&gt;PRINCOMP leaves the input data set umodified, and adds the principal component scores to the OUT= data set.&amp;nbsp; So you should be using syntax something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc princomp data=myData  out=PCOUT  &amp;lt;other options&amp;gt;;
  var ...
run;

proc corr data=PCOUT &amp;lt;options&amp;gt;;
  var ...
  with ...
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jun 2020 07:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/656071#M5153</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2020-06-10T07:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/656351#M5154</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332033"&gt;@axelpuri&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Prin1 is the principal component 1 . I need a correlation table for the original variables with the PCs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cant do that using the component pattern profile plot as there are 9 variables and hence 9 PCs and it looooks really cluttered&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Further i could have gleaned more information from the component plots but i dont get the all plots for all the different combinations of PCS and&amp;nbsp; variables&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only option left now is to get the correlations in a tabular format but i cant seem to run the code because of&amp;nbsp; the error for Prin1 when its clearly a PC as you can see from the eigenvectors table.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm glad you have the answer now, but a simple debugging step when SAS says it cannot find a variable, which you could perform yourself, is to look at PROC CONTENTS. In fact, this ought to be the first thing to do when you get that error.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 11:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/656351#M5154</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-10T11:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between original variables and PCA?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/656353#M5155</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332033"&gt;@axelpuri&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Btw i was able to get the table just now&lt;BR /&gt;What i dont understand is why didn't i have to enter my data as work.mydatasetname in the data= ... part ?&lt;BR /&gt;/* what are the correlations between PCs and orig vars? */&lt;BR /&gt;proc corr data=PCOUT noprob nosimple;&lt;BR /&gt;var MW LogP LogD Hdonors Hacceptors PSA ROT NATOM NRING;&lt;BR /&gt;with Prin1-Prin9;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;What does PCout mean ?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PCOUT is the name of a data set created by PROC PRINCOMP in the code above. It contains both the original variables and the principal components (PRIN1-PRIN9) variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if you are going to produce a correlation analysis between the original variables and the principal component variables, they must be in the same data set, which in this case is PCOUT. If you run PROC CORR on PCOUT, you can obtain the desired correlations.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 11:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Correlation-between-original-variables-and-PCA/m-p/656353#M5155</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-10T11:10:34Z</dc:date>
    </item>
  </channel>
</rss>

