<?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: Help with Pearson Corrrelation coefficients and probabilities in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426627#M281332</link>
    <description>&lt;P&gt;Try PROC TRANSPOSE if you need a dynamic option. If you need just for your example data, then&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;code is suitable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would like need a double transpose, once to a wide format and once to the desired format.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2018 20:21:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-01-10T20:21:53Z</dc:date>
    <item>
      <title>Help with Pearson Corrrelation coefficients and probabilities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426622#M281330</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the pearson correlation coefficents and respective probabilities for the&lt;BR /&gt;independent variables of a regression in a nice table (like dataset3 below).&lt;BR /&gt;First for one regression, then I'll be adding more regressions to the dataset&lt;BR /&gt;(dataset3 below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;First I ran this code to get the output in dataset1&lt;/P&gt;&lt;P&gt;ods output PearsonCorr=dataset1;&lt;BR /&gt;proc corr data=originaldata;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;dataset1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Label&amp;nbsp;&amp;nbsp;&amp;nbsp; x1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; PX1&amp;nbsp;&amp;nbsp;&amp;nbsp; PX2&amp;nbsp;&amp;nbsp;&amp;nbsp; PY&lt;BR /&gt;X1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.25&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.10&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; _&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; 0.23&amp;nbsp;&amp;nbsp; 0.26&lt;BR /&gt;X2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.25&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.00&amp;nbsp;&amp;nbsp; -0.14&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.23&amp;nbsp;&amp;nbsp;&amp;nbsp; _&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.20&lt;BR /&gt;Y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.10&amp;nbsp;&amp;nbsp; -0.14&amp;nbsp;&amp;nbsp; 1.00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.26&amp;nbsp;&amp;nbsp; 0.20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;It has more columns/values than I need, so&lt;BR /&gt;modified above data with below code to get dataset2&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data pearsoncorrelations2;&lt;BR /&gt;set dataset1;&lt;BR /&gt;if Variable = "Y" then output;&lt;BR /&gt;run;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;dataset2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Variable&amp;nbsp; Label&amp;nbsp;&amp;nbsp;&amp;nbsp; X1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X2&amp;nbsp;&amp;nbsp;&amp;nbsp; Y&amp;nbsp;&amp;nbsp;&amp;nbsp; PX&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PX2&amp;nbsp;&amp;nbsp; PY&lt;BR /&gt;Y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.10&amp;nbsp; -&amp;nbsp; 0.14&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.20&amp;nbsp;&amp;nbsp; _&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;But now I need&lt;BR /&gt;the data in the following format, but how do i do that? I also&lt;BR /&gt;don't need the Label and PY columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dataset3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pearsoncoefs&amp;nbsp;PROB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;X1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;X2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -0.14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 20:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426622#M281330</guid>
      <dc:creator>ubshams</dc:creator>
      <dc:date>2018-01-10T20:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Pearson Corrrelation coefficients and probabilities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426623#M281331</link>
      <description>&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;pearsoncoefs =x1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PROB&amp;nbsp; &amp;nbsp; =PX1&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;variable=vname(x1);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;pearsoncoefs =x2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PROB&amp;nbsp; &amp;nbsp; =PX2&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;variable=vname(x2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;keep Variable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pearsoncoefs&amp;nbsp;PROB ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 20:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426623#M281331</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-10T20:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Pearson Corrrelation coefficients and probabilities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426627#M281332</link>
      <description>&lt;P&gt;Try PROC TRANSPOSE if you need a dynamic option. If you need just for your example data, then&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;code is suitable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would like need a double transpose, once to a wide format and once to the desired format.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 20:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426627#M281332</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-10T20:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Pearson Corrrelation coefficients and probabilities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426645#M281333</link>
      <description>&lt;P&gt;Thanks both for your quick responses. It works now but as you can imagine I don't want to&lt;/P&gt;&lt;P&gt;have to manually type in the name of the variables as for some regressions there might be more than 2 variables. Is there a way to do that? I was looking into the syntax for the "%do loop in SAS but it didn't look like it works for this case (variable names).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 20:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426645#M281333</guid>
      <dc:creator>ubshams</dc:creator>
      <dc:date>2018-01-10T20:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Pearson Corrrelation coefficients and probabilities</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426648#M281334</link>
      <description>&lt;P&gt;Try proc transpose as suggested by Reeza&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 20:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Pearson-Corrrelation-coefficients-and-probabilities/m-p/426648#M281334</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-10T20:59:59Z</dc:date>
    </item>
  </channel>
</rss>

