<?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: creating a table of highly correlated values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802163#M315778</link>
    <description>&lt;A href="https://blogs.sas.com/content/iml/2017/08/16/pairwise-correlations-bar-chart.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/08/16/pairwise-correlations-bar-chart.html&lt;/A&gt;</description>
    <pubDate>Tue, 15 Mar 2022 12:39:17 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2022-03-15T12:39:17Z</dc:date>
    <item>
      <title>creating a table of highly correlated values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802043#M315699</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have a datasets that contains over 220 variables (include dummies that represents nominal). however, I would like to create a table that highlights highly correlated data (&lt;STRONG&gt;with |correlation| &amp;gt;60%&lt;/STRONG&gt;) only.&lt;/P&gt;
&lt;P&gt;as an example, if I ran the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;&lt;BR /&gt;input v1-v7;&lt;BR /&gt;cards;&lt;BR /&gt;1 4 5 33 6 1 0&lt;BR /&gt;9 11 32 5 4 1 0&lt;BR /&gt;0 4 5 4 77 0 0&lt;BR /&gt;1 2 9 9 5 1 1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc corr data = have OUTP= corr;&lt;BR /&gt;var v1-v7;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if I ran the code above I'll get&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Abdulla1_1-1647285295253.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69453i9933342C8FE57022/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Abdulla1_1-1647285295253.png" alt="Abdulla1_1-1647285295253.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what I'm trying to generate is the following table:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;VARIABLE1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;VARIABLE2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;CORR&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;V1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;V2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;0.95&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;V1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;V3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;0.99&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;V2&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;V3&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;0.92&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;V5&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;V6&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="30px"&gt;-0.99&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 14 Mar 2022 19:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802043#M315699</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-03-14T19:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: creating a table of highly correlated values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802044#M315700</link>
      <description>&lt;P&gt;SORRY i DON'T KNOW WHY THE SAS CODE switched to this form:&lt;/P&gt;
&lt;P&gt;here it is again:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data have;&lt;BR /&gt;input v1-v7;&lt;BR /&gt;cards;&lt;BR /&gt;1 4 5 33 6 1 0&lt;BR /&gt;9 11 32 5 4 1 0&lt;BR /&gt;0 4 5 4 77 0 0&lt;BR /&gt;1 2 9 9 5 1 1&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc corr data = have OUTP= corr;&lt;BR /&gt;var v1-v7;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 19:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802044#M315700</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-03-14T19:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: creating a table of highly correlated values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802045#M315701</link>
      <description>&lt;P&gt;Create a list, which only has abs(correlations) above a certain cutoff.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EXAMPLE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data=sashelp.class noprob nosimple;
    var age height weight;
    ods output pearsoncorr=corrs;
run;

data want;
    set corrs;
    length variable2 $ 32;
    array r _numeric_;
    do j=_n_+1 to dim(r);
        corr=r(j);
        variable2=vname(r(j));
        if abs(corr)&amp;gt;0.6 then output;
    end;
    keep variable corr variable2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 19:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802045#M315701</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-14T19:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: creating a table of highly correlated values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802049#M315704</link>
      <description>&lt;P&gt;There are many function that I have never used before here. Thank you very much. I learned a lot from your code&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 19:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802049#M315704</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-03-14T19:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: creating a table of highly correlated values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802163#M315778</link>
      <description>&lt;A href="https://blogs.sas.com/content/iml/2017/08/16/pairwise-correlations-bar-chart.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/08/16/pairwise-correlations-bar-chart.html&lt;/A&gt;</description>
      <pubDate>Tue, 15 Mar 2022 12:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802163#M315778</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-03-15T12:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: creating a table of highly correlated values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802264#M315818</link>
      <description>&lt;P&gt;that is a great way of visualizing the output. I really appreciate your input.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 16:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-a-table-of-highly-correlated-values/m-p/802264#M315818</guid>
      <dc:creator>Abdulla1</dc:creator>
      <dc:date>2022-03-15T16:04:09Z</dc:date>
    </item>
  </channel>
</rss>

