<?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 summed and log transformed variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485944#M71898</link>
    <description>&lt;P&gt;You must create the new variables &lt;U&gt;in a new dataset&lt;/U&gt; before calling proc corr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create a new dataset from BGA_88 called BGA_88_new */
data BGA_88_new;
set BGA_88;
ser_total_lut=sum (ser_lut1, ser_lut2, ser_lut3, ser_lut4, ser_lut5);
ser_lut1_zea=sum (ser_lut1, ser_zea);
run;

/* Call proc corr with the new dataset */
proc corr data=BGA_88_new pearson spearman nosimple 
    plots=matrix(histogram);
var ser_total_lut ser_lut1_zea var1 var2;
with var9 var10;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 Aug 2018 20:38:42 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-08-10T20:38:42Z</dc:date>
    <item>
      <title>Correlation with summed and log transformed variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485633#M71877</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using SAS studio on Mac and have a few questions using Correlation task:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have a total of&amp;nbsp;8 analysis variables (below) that I wish to correlate with several&amp;nbsp;other variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MRI_mean&lt;/P&gt;&lt;P&gt;ser_lut1&lt;/P&gt;&lt;P&gt;ser_lut2&lt;/P&gt;&lt;P&gt;ser_lut3&lt;/P&gt;&lt;P&gt;ser_lut4&lt;/P&gt;&lt;P&gt;ser_lut5&lt;/P&gt;&lt;P&gt;ser_zea&lt;/P&gt;&lt;P&gt;diet_lut_zea&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition,&amp;nbsp;I also want to correlate the &lt;STRONG&gt;sum&lt;/STRONG&gt; of ser_lut1-5 and call it "ser_total_lut" and the &lt;STRONG&gt;sum&lt;/STRONG&gt; of ser_lut1 and ser_zea and call it "ser_lut1_zea". After submitting the program for correlation analysis. I went to the edit the code and &amp;nbsp;tried the function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ser_total_lut=sum (ser_lut1,&amp;nbsp;ser_lut2,&amp;nbsp;ser_lut3,&amp;nbsp;ser_lut4,&amp;nbsp;ser_lut5) &amp;nbsp;&lt;/STRONG&gt;and&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ser_lut1_zea=sum (ser_lut1, ser_zea)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after the&lt;STRONG&gt; var &lt;/STRONG&gt;statement like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc corr data=LIBREF.FILENAME&amp;nbsp; pearson spearman rank plots=matrix(histogram);&lt;BR /&gt;var&amp;nbsp;&lt;SPAN&gt;MRI_mean&amp;nbsp;ser_lut1&amp;nbsp;ser_lut2&amp;nbsp;ser_lut3&amp;nbsp;ser_lut4&amp;nbsp;ser_lut5&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;ser_total_lut=sum (ser_lut1,&amp;nbsp;ser_lut2,&amp;nbsp;ser_lut3,&amp;nbsp;ser_lut4,&amp;nbsp;ser_lut5)&amp;nbsp;ser_lut1_zea=sum (ser_lut1, ser_zea)&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;ser_zea&amp;nbsp;diet_lut_zea;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;with OCL1 OCL2 OCL3 OCL4;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't sure whether or not to add commas in between variables in the parentheses so I ran with and without and got the same error message: Any help on what I'm doing wrong?&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Lastly, I wish to log transform 2 variables (&lt;SPAN&gt;ser&lt;/SPAN&gt;&lt;SPAN&gt;_lut1 and&amp;nbsp;ser_lut2)&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;before running correlation analysis. How would I do there? Where does the code go? Sorry for all the questions...still a newbie here.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;THANKS! J&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 00:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485633#M71877</guid>
      <dc:creator>jenfumi</dc:creator>
      <dc:date>2018-08-10T00:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation with summed and log transformed variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485661#M71880</link>
      <description>&lt;P&gt;You must create the new variables in a new dataset before calling proc corr. The syntax is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newVar = sum(var1, var2, var3);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or equivalently&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newVar = sum(of var1 var2 var3);&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 05:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485661#M71880</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-08-10T05:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation with summed and log transformed variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485922#M71896</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the assistance. I tried putting the syntax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ser_total_lut=&lt;SPAN class="lia-search-match-lithium"&gt;sum&lt;/SPAN&gt; (ser_lut1,&amp;nbsp;ser_lut2,&amp;nbsp;ser_lut3,&amp;nbsp;ser_lut4,&amp;nbsp;ser_lut5);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ser_lut1_zea=&lt;SPAN class="lia-search-match-lithium"&gt;sum&lt;/SPAN&gt; (ser_lut1, ser_zea);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;before the proc corr step as seen below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods noproctitle;&lt;BR /&gt;ods graphics / imagemap=on;&lt;/P&gt;&lt;P&gt;ser_total_lut=&lt;SPAN class="lia-search-match-lithium"&gt;sum&lt;/SPAN&gt; (ser_lut1,&amp;nbsp;ser_lut2,&amp;nbsp;ser_lut3,&amp;nbsp;ser_lut4,&amp;nbsp;ser_lut5);&lt;/P&gt;&lt;P&gt;ser_lut1_zea=&lt;SPAN class="lia-search-match-lithium"&gt;sum&lt;/SPAN&gt; (ser_lut1, ser_zea);&lt;/P&gt;&lt;P&gt;proc corr data=WORK.BGA_88 pearson spearman nosimple&amp;nbsp;&lt;/P&gt;&lt;P&gt;plots=matrix(histogram);&lt;BR /&gt;var&amp;nbsp;&lt;SPAN&gt;ser_total_lut&amp;nbsp;ser_lut1_zea var1 var2;&lt;/SPAN&gt;&lt;BR /&gt;with var9 var10;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but there was an ERROR: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 19:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485922#M71896</guid>
      <dc:creator>jenfumi</dc:creator>
      <dc:date>2018-08-10T19:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation with summed and log transformed variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485944#M71898</link>
      <description>&lt;P&gt;You must create the new variables &lt;U&gt;in a new dataset&lt;/U&gt; before calling proc corr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create a new dataset from BGA_88 called BGA_88_new */
data BGA_88_new;
set BGA_88;
ser_total_lut=sum (ser_lut1, ser_lut2, ser_lut3, ser_lut4, ser_lut5);
ser_lut1_zea=sum (ser_lut1, ser_zea);
run;

/* Call proc corr with the new dataset */
proc corr data=BGA_88_new pearson spearman nosimple 
    plots=matrix(histogram);
var ser_total_lut ser_lut1_zea var1 var2;
with var9 var10;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Aug 2018 20:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485944#M71898</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-08-10T20:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation with summed and log transformed variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485983#M71906</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great that worked, thank you! I'm still a&amp;nbsp;novice at SAS and trying learning all the terminology.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing, could you assist with the syntax for log transforming variables to be used in correlation analysis?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN&gt;ser_lut1&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN&gt;ser_lut2&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 23:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485983#M71906</guid>
      <dc:creator>jenfumi</dc:creator>
      <dc:date>2018-08-10T23:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation with summed and log transformed variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485995#M71908</link>
      <description>&lt;P&gt;Just the same, add them to your new dataset&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create a new dataset from BGA_88 called BGA_88_new */
data BGA_88_new;
set BGA_88;
ser_total_lut=sum (ser_lut1, ser_lut2, ser_lut3, ser_lut4, ser_lut5);
ser_lut1_zea=sum (ser_lut1, ser_zea);
log_ser_lut1 = log(ser_lut1);
log_ser_lut2 = log(ser_lut2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Aug 2018 02:22:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/485995#M71908</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-08-11T02:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation with summed and log transformed variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/486010#M71911</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see, great thanks again. Greatly appreciated! ~J&lt;/P&gt;</description>
      <pubDate>Sat, 11 Aug 2018 04:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Correlation-with-summed-and-log-transformed-variables/m-p/486010#M71911</guid>
      <dc:creator>jenfumi</dc:creator>
      <dc:date>2018-08-11T04:50:39Z</dc:date>
    </item>
  </channel>
</rss>

