<?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 with thousand variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345035#M79338</link>
    <description>&lt;P&gt;Answer to first question: run proc contents on the file to identify the first and last variables in the set. Then you can simply specify them in a list like:&amp;nbsp;&lt;SPAN&gt;TC01000005_hg_1--&lt;/SPAN&gt;&lt;SPAN&gt;TC010000019_hg_1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second question:&lt;/P&gt;
&lt;PRE&gt;proc corr data=myData best=50;
  var Var1;
  with var2--var99;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Third question: I don't know, but I don't see why it wouldn't.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Art, CEO, AnalystFinder.com&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2017 15:39:39 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-03-28T15:39:39Z</dc:date>
    <item>
      <title>correlation with thousand variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345023#M79335</link>
      <description>&lt;P&gt;Dear SAS community members,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working in scientific research. I would like to run simultaneously correlations between one variable (eg blood cholesterol) and thousand of others (names of&amp;nbsp;thousand genes).&lt;/P&gt;&lt;P&gt;The name of the variables look like this (and continues up to some thousands):&lt;BR /&gt;&lt;BR /&gt;TC01000005_hg_1, TC01000006_hg_1, TC01000008_hg_1, TC01000009_hg_1,&amp;nbsp;&lt;BR /&gt;TC01000010_hg_1, TC01000011_hg_1, TC01000012_hg_1, TC01000013_hg_1,&amp;nbsp;&lt;BR /&gt;TC01000014_hg_1, TC01000015_hg_1, TC01000016_hg_1, TC01000017_hg_1,&amp;nbsp;&lt;BR /&gt;TC01000018_hg_1, TC01000019_hg_1&lt;BR /&gt;&lt;BR /&gt;My first question is how I should type the command so that I can include all those thousand variables. I have seen a syntax like the following;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc corr data=myData;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var Var1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;with var2-var99;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how should I transform it in order to include my type of variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My second question is how I should type the "BEST" command so that, after running the thousands correlations, I could have a list of the top 50 results. This should include the 50 variable names with the highest (or lowest) R value and the lowest p value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My third question, is it possible to run this type of correlations (one variable against 30.000 variables) in SAS university edition. I have assigned 7GB out of 8 total GB RAM for the VM Box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much in advance!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Apo&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345023#M79335</guid>
      <dc:creator>Apo</dc:creator>
      <dc:date>2017-03-28T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: correlation with thousand variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345032#M79336</link>
      <description>&lt;P&gt;Another form of variable list is to use the starting characters of a group of similarly named variables ending with a :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With TC: ;&lt;/P&gt;
&lt;P&gt;would compare your variable on the VAR statement with all variables whose names start with the characters TC.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345032#M79336</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-28T15:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: correlation with thousand variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345035#M79338</link>
      <description>&lt;P&gt;Answer to first question: run proc contents on the file to identify the first and last variables in the set. Then you can simply specify them in a list like:&amp;nbsp;&lt;SPAN&gt;TC01000005_hg_1--&lt;/SPAN&gt;&lt;SPAN&gt;TC010000019_hg_1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second question:&lt;/P&gt;
&lt;PRE&gt;proc corr data=myData best=50;
  var Var1;
  with var2--var99;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Third question: I don't know, but I don't see why it wouldn't.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Art, CEO, AnalystFinder.com&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345035#M79338</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-28T15:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: correlation with thousand variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345244#M79395</link>
      <description>&lt;P&gt;SAS/IML is the best way to do that.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;might be interesting.&lt;/P&gt;
&lt;P&gt;Post your data and output you want see here.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 03:12:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345244#M79395</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-29T03:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: correlation with thousand variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345284#M79418</link>
      <description>&lt;P&gt;Dear art297&lt;/P&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code functions perfectly! The only problem is that, when I try to start the correlation analysis of my variable with around 10.000 variables, SAS stops and shows the following message;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: The SAS System stopped processing this step because of insufficient memory.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The data set WORK.NEW4 may be incomplete. When this step was stopped there were 0 observations and 3 variables.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Data set WORK.NEW4 was not replaced because this step was stopped.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE CORR used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.47 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.39 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;My SAS university edition is running on 2 cores and on 7GB RAM. Do you think I should use a faster computer or a standard non-university SAS edition?&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Thank you once again&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Mar 2017 09:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345284#M79418</guid>
      <dc:creator>Apo</dc:creator>
      <dc:date>2017-03-29T09:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: correlation with thousand variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345286#M79419</link>
      <description>Thank you so much for this reply!&lt;BR /&gt;However, I have problems trying to run correlations of my variable (200 obs) with 10.000 variables (200 obs each), insufficient memory.&lt;BR /&gt;&lt;BR /&gt;ERROR: The SAS System stopped processing this step because of insufficient memory.&lt;BR /&gt;WARNING: The data set WORK.NEW4 may be incomplete. When this step was stopped there were 0 observations and 3 variables.&lt;BR /&gt;WARNING: Data set WORK.NEW4 was not replaced because this step was stopped.&lt;BR /&gt;NOTE: PROCEDURE CORR used (Total process time):&lt;BR /&gt;real time 0.47 seconds&lt;BR /&gt;cpu time 0.39 seconds&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Mar 2017 09:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345286#M79419</guid>
      <dc:creator>Apo</dc:creator>
      <dc:date>2017-03-29T09:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: correlation with thousand variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345495#M79483</link>
      <description>&lt;P&gt;It helps to show the entire code when you get an error. Some things that may help: use option NOPRINT on the Proc Corr statement to reduce the printed output which takes memory trying to format things. Direct the desired statistics to data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have to break the data into groups. If you use the -- operator , that is two dashes, in a variable list then the variables that are in order are selected;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with TC01000005_hg_1 -- TC01000019_hg_1;&amp;nbsp; would select adjacent columns in the data set with the leftmost the first variable and the last being the right-most column of that group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to say that when you said you had 1000s of variables I was afraid there might be a memory issue.&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, 29 Mar 2017 18:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correlation-with-thousand-variables/m-p/345495#M79483</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-29T18:36:52Z</dc:date>
    </item>
  </channel>
</rss>

