<?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 PROC CORR | Output correlation coefficients in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863249#M38136</link>
    <description>&lt;P&gt;Is there a way to output the&amp;nbsp;correlation coefficients from a correlation matrix produced by PROC CORR and use them in a calculation to create a new variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is to assess multicollinearity using the following calculation:&lt;/P&gt;
&lt;P&gt;new_var =&amp;nbsp; (correlation coefficient)^2 x 100 = % of information shared by the 2 variables&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2023 18:42:28 GMT</pubDate>
    <dc:creator>_maldini_</dc:creator>
    <dc:date>2023-03-09T18:42:28Z</dc:date>
    <item>
      <title>PROC CORR | Output correlation coefficients</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863249#M38136</link>
      <description>&lt;P&gt;Is there a way to output the&amp;nbsp;correlation coefficients from a correlation matrix produced by PROC CORR and use them in a calculation to create a new variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is to assess multicollinearity using the following calculation:&lt;/P&gt;
&lt;P&gt;new_var =&amp;nbsp; (correlation coefficient)^2 x 100 = % of information shared by the 2 variables&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 18:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863249#M38136</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2023-03-09T18:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CORR | Output correlation coefficients</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863251#M38137</link>
      <description>&lt;P&gt;Suggest that you provide the Proc Corr code and which coefficient(s) you want.&lt;/P&gt;
&lt;P&gt;ODS OUTPUT is the most likely.&lt;/P&gt;
&lt;P&gt;An example you should be able to run. Note that each option creates different tables that can be found in the DETAILS section of the Proc Corr to determine which table, such as the Pearsoncorr below, to request. The bit after the = is the name of the data set to create, assuming your remaining syntax is correct&lt;/P&gt;
&lt;PRE&gt;proc corr data=sashelp.class
   pearson spearman ;
   ods output pearsoncorr=pcoef 
              SpearmanCorr=scoef
   ;
   var height weight;
run;
  &lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Mar 2023 18:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863251#M38137</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-09T18:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CORR | Output correlation coefficients</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863266#M38138</link>
      <description>&lt;P&gt;Yikes...Working w/ this example, adding age, taking the output data set&amp;nbsp;pcoef, I would want to create a new variable that goes thru each column and squares the Pearson correlation coefficient and then multiplies it by 100.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-03-09 at 11.23.18 AM.png" style="width: 396px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81270i57F000FBBBEB0E75/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-03-09 at 11.23.18 AM.png" alt="Screenshot 2023-03-09 at 11.23.18 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-03-09 at 11.23.27 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81271i23574AB4345544D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-03-09 at 11.23.27 AM.png" alt="Screenshot 2023-03-09 at 11.23.27 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-03-09 at 11.23.51 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81272iC555B5F73551189E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-03-09 at 11.23.51 AM.png" alt="Screenshot 2023-03-09 at 11.23.51 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How would I do that for a matrix of variables?&lt;/P&gt;
&lt;P&gt;This may be too complicated. I'm also &lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Tolerance-and-Variance-Inflation-Factor/m-p/863264#M42682" target="_self"&gt;trying to assess multicollinearity a different way&lt;/A&gt;. I just wanted to see how this approach might work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 19:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863266#M38138</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2023-03-09T19:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CORR | Output correlation coefficients</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863271#M38140</link>
      <description>&lt;P&gt;Seems trivial.&amp;nbsp; Use PROC CORR to generate correlation dataset.&amp;nbsp; Transpose it to make it easier to work with. Generate you new variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data=sashelp.class outp=CORR;
   var height weight age;
run;

proc transpose data=corr(rename=(_name_=left)) name=right out=TALL(rename=(col1=CORR));
 where _type_='CORR';
 by left notsorted;
run;

data want;
  set tall;
  new_var =  corr**2 * 100;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1678391676314.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81274i22EA61060457F915/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1678391676314.png" alt="Tom_0-1678391676314.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can figure out how to add some logic to eliminate the duplicates.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 19:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863271#M38140</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-09T19:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC CORR | Output correlation coefficients</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863283#M38141</link>
      <description>&lt;P&gt;If you only want the correlation between specific variables you can reduce the proc corr results by using Var and With statements.&lt;/P&gt;
&lt;P&gt;Such as&lt;/P&gt;
&lt;PRE&gt;proc corr data=sashelp.class
   pearson spearman kendall hoeffding;
   ods output pearsoncorr=pcoef 
              SpearmanCorr=scoef
   ;
   var height  ;
   with weight;
run;
  &lt;/PRE&gt;
&lt;P&gt;The output above does not have a "matrix".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You still have not shared your Proc Corr or even which variables you are specifically concerned about.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 20:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-CORR-Output-correlation-coefficients/m-p/863283#M38141</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-09T20:43:08Z</dc:date>
    </item>
  </channel>
</rss>

