<?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 Identifying perfectly correlated variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665214#M198865</link>
    <description>&lt;P&gt;I'm trying to identify which of my variables are perfectly correlated so that I can remove one of them in order to run a principal component analysis. The large number of variables in my dataset makes it hard to find based on visual inspection alone, so is there an easier way for me to identify those pairs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data = sashelp.applianc out = have;
 var units_:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Jun 2020 01:11:59 GMT</pubDate>
    <dc:creator>bkq32</dc:creator>
    <dc:date>2020-06-26T01:11:59Z</dc:date>
    <item>
      <title>Identifying perfectly correlated variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665214#M198865</link>
      <description>&lt;P&gt;I'm trying to identify which of my variables are perfectly correlated so that I can remove one of them in order to run a principal component analysis. The large number of variables in my dataset makes it hard to find based on visual inspection alone, so is there an easier way for me to identify those pairs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data = sashelp.applianc out = have;
 var units_:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jun 2020 01:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665214#M198865</guid>
      <dc:creator>bkq32</dc:creator>
      <dc:date>2020-06-26T01:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying perfectly correlated variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665234#M198872</link>
      <description>&lt;P&gt;Here is a simple way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data = sashelp.applianc outp = have(where=(_type_="CORR")) noprint;
 var units_:;
run;

proc transpose data=have name=_name2_ 
    out=want(where=(_name_ &amp;gt; _name2_ and col1&amp;gt;0.99) drop=_label_);
by _name_ notsorted;
var units_:;
run;

proc print data=want noobs; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;_NAME_ 	        _name2_ 	COL1
units_4 	units_16 	0.99991
units_4 	units_17 	0.99989
units_4 	units_18 	0.99989
units_17 	units_16 	0.99990
units_18 	units_16 	0.99991
units_18 	units_17 	0.99989
units_20 	units_19 	1.00000
units_22 	units_19 	0.99999
units_22 	units_20 	0.99999
units_24 	units_19 	1.00000
units_24 	units_20 	1.00000
units_24 	units_22 	0.99999&lt;/PRE&gt;
&lt;P&gt;Note that this will not identify other typess of colinearity such as when z = x + y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 04:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665234#M198872</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-06-26T04:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying perfectly correlated variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665293#M198897</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt; Thank you! Do you mind explaining why this wouldn't identify other types of collinearity?</description>
      <pubDate>Fri, 26 Jun 2020 09:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665293#M198897</guid>
      <dc:creator>bkq32</dc:creator>
      <dc:date>2020-06-26T09:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying perfectly correlated variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665300#M198900</link>
      <description>&lt;P&gt;There can be linear combinations of variables that are perfectly correlated. So, for example, if x1+3*X3 = x5 -7*x8+2*x10, then you have perfect correlation there, and PROC CORR only looks at correlations of pairs of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to find these linear combinations that are correlated, you can use PROC PRINCOMP and look for the vectors associated with zero eigenvalues.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 10:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665300#M198900</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-26T10:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying perfectly correlated variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665302#M198901</link>
      <description>Got it, that makes sense. Thank you very much for the explanation.</description>
      <pubDate>Fri, 26 Jun 2020 10:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-perfectly-correlated-variables/m-p/665302#M198901</guid>
      <dc:creator>bkq32</dc:creator>
      <dc:date>2020-06-26T10:43:32Z</dc:date>
    </item>
  </channel>
</rss>

