<?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: proc corr two sided in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236983#M12554</link>
    <description>&lt;P&gt;As far as I know, the significance tests in PROC CORR are always two-sided.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2015 15:18:04 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2015-11-30T15:18:04Z</dc:date>
    <item>
      <title>proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236968#M12553</link>
      <description>&lt;P&gt;I am looking to replicate code from Spss..to SAS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Correlation Matrix.&lt;BR /&gt;CORRELATIONS&lt;BR /&gt;/VARIABLES=A B C D E F G&lt;BR /&gt;/PRINT=TWOTAIL NOSIG&lt;BR /&gt;/MISSING=PAIRWISE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS OUTPUT PearsonCorr=TEST1 /*;
PROC CORR DATA=TEST  OUTP=CORRS;
 VAR A B C D E F G;
RUN;
ODS LISTING;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When i run the above code in spss and sas. Although the Correlations are the same the signifiance levels differ..How do you specify the twotail method in SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 14:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236968#M12553</guid>
      <dc:creator>timkill1982</dc:creator>
      <dc:date>2015-11-30T14:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236983#M12554</link>
      <description>&lt;P&gt;As far as I know, the significance tests in PROC CORR are always two-sided.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 15:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236983#M12554</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-11-30T15:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236984#M12555</link>
      <description>&lt;P&gt;I believe the default is two-sided p-values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible that SPSS is using a different statistic calculate the p-values? For example, it might be applying Fisher's Z transformation with a bias adjustment?&amp;nbsp; If so, try using the FISHER option on the PROC CORR statement.&amp;nbsp;The doc shows how to&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/viewer.htm#procstat_corr_syntax01.htm" target="_self"&gt;control the Fisher transformation&lt;/A&gt;&amp;nbsp;parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default, PROC CORR using a t statistic compute the p-values for Pearson's correlation.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 15:18:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236984#M12555</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-11-30T15:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236990#M12556</link>
      <description>&lt;P&gt;I don't have SPSS, but I found an example on the web:&amp;nbsp;&lt;A href="http://davidmlane.com/SPSS/correlation.html" target="_blank"&gt;davidmlane.com/SPSS/correlation.html&lt;/A&gt;. Exactly the same SPSS syntax is used there as in your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I analyzed the data for Y1 and Y2 with PROC CORR and obtained not only the same correlations but also the same p-values, up to rounding in both cases: 0.11607 vs. .116 and 0.8526 vs. .853.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you get different results with either SPSS or SAS on that simple dataset? Or can you provide sample data and p-values from your example?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ttt;
input y1 y2;
cards;
5 8.5
6 9.5
3 7
7 6.5
5 5.75
;

ods output PearsonCorr=test1;
proc corr data=ttt outp=corrs;
var y1 y2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Nov 2015 15:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236990#M12556</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2015-11-30T15:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236999#M12557</link>
      <description>&lt;P&gt;Using that simple example the outputs match...i better take a closer look to see whats happening with my data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 15:40:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/236999#M12557</guid>
      <dc:creator>timkill1982</dc:creator>
      <dc:date>2015-11-30T15:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237006#M12558</link>
      <description>&lt;P&gt;the spss code applies a weight.&lt;/P&gt;&lt;P&gt;*Weight data.&lt;BR /&gt;WEIGHT BY&amp;nbsp;testweight.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*Correlation Matrix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CORRELATIONS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/VARIABLES=A B C D E F G&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/PRINT=TWOTAIL NOSIG&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/MISSING=PAIRWISE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if i add the weight statement in SAS, i would expect the same answer as spss but it stays the same as previous!!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS OUTPUT PearsonCorr=TEST1 /*;
PROC CORR DATA=TEST  OUTP=CORRS;
weight testweight;
 VAR A B C D E F G;
RUN;
ODS LISTING;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 16:27:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237006#M12558</guid>
      <dc:creator>timkill1982</dc:creator>
      <dc:date>2015-11-30T16:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237010#M12559</link>
      <description>&lt;P&gt;I had the same problem with TTEST last week that the WEIGHT/FREQ&amp;nbsp;statement doesn't work correctly. Most of the testweights&amp;nbsp;range from 0.3-2.89&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 16:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237010#M12559</guid>
      <dc:creator>timkill1982</dc:creator>
      <dc:date>2015-11-30T16:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237025#M12560</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FREQ statement in PROC CORR; read this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/viewer.htm#procstat_corr_syntax03.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/viewer.htm#procstat_corr_syntax03.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;WEIGHT statement in PROC CORR; read this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/viewer.htm#procstat_corr_syntax07.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/procstat/68142/HTML/default/viewer.htm#procstat_corr_syntax07.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;both excerpts coming from:&lt;/P&gt;
&lt;P&gt;Base SAS(R) 9.4 Procedures Guide: Statistical Procedures, Fourth Edition&lt;/P&gt;
&lt;P&gt;The CORR Procedure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nothing wrong with the weight statement in PROC CORR!&lt;/P&gt;
&lt;P&gt;I see that your code has unbalanced comment marks (a trailing '&lt;FONT face="courier new,courier"&gt;/*&lt;/FONT&gt;'). Could that be the reason nothing changes?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 18:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237025#M12560</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2015-11-30T18:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237050#M12562</link>
      <description>&lt;P&gt;&lt;A href="http://www-01.ibm.com/support/knowledgecenter/SSLVMB_20.0.0/com.ibm.spss.statistics.help/idh_weig.htm?lang=en" target="_blank"&gt;SPSS documentation about the WEIGHT statement&lt;/A&gt;&amp;nbsp;says that "&lt;EM&gt;...&amp;nbsp;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;some procedures, such as Frequencies, Crosstabs, and Custom Tables, will use fractional weight values. However, most procedures treat the weighting variable as a replication weight and will simply round fractional weights to the nearest integer. Some procedures ignore the weighting variable completely ...&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regardless whether SPSS CORRELATIONS uses rounded or fractional weights, I'm sure we'll be able to clarify this if you provide us with the SPSS result (correlation coefficient, p-value and whatever else it may report) for the following example data (which are the same as we had earlier today, just a weight variable W added):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ttt;
input y1 y2 w;
cards;
5 8.5  0.3
6 9.5  0.8
3 7    1.1
7 6.5  1.6
5 5.75 2.89 
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Nov 2015 21:01:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237050#M12562</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2015-11-30T21:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237132#M12567</link>
      <description>&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Correlations&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;y1&lt;/TD&gt;&lt;TD&gt;y2&lt;/TD&gt;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TR&gt;&lt;TR&gt;&lt;TD&gt;y2&lt;/TD&gt;&lt;TD&gt;0.08796&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0.8882&lt;/TD&gt;&lt;TD&gt;_&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;sas output&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The correlations are the same but the P values differ!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 09:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237132#M12567</guid>
      <dc:creator>timkill1982</dc:creator>
      <dc:date>2015-12-01T09:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237143#M12569</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/63393"&gt;@timkill1982﻿&lt;/a&gt;, for providing the SPSS results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The explanation for the different p-values is: SPSS uses the sum of the weights, 0.3+0.8+1.1+1.6+2.89=&lt;STRONG&gt;6.69, &lt;/STRONG&gt;minus 2&amp;nbsp;as the (fractional) number of degrees of freedom in the calculation of the p-value (based on the t distribution), whereas SAS uses the number of observations, i.e. &lt;STRONG&gt;5&lt;/STRONG&gt;, minus 2, as shown below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
r = 0.08795657670103; /* Pearson correlation coefficient */
n_sas  = 5;     /* number of observations */
n_spss = 6.69;  /* sum of weights */
p_sas  = 2*(1-probt(sqrt((n_sas -2)*r**2/(1-r**2)),n_sas -2));
p_spss = 2*(1-probt(sqrt((n_spss-2)*r**2/(1-r**2)),n_spss-2));
put 'p_sas  = ' p_sas;
put 'p_spss = ' p_spss;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The formulas can be found in the respective documentation:&amp;nbsp;&lt;A href="http://www-01.ibm.com/support/knowledgecenter/SSLVMB_20.0.0/com.ibm.spss.statistics.help/alg_correlation_signif.htm?lang=en" target="_blank"&gt;SPSS&lt;/A&gt;, &lt;A href="http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_corr_sect013.htm" target="_blank"&gt;SAS&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interestingly, SPSS says N=7 in the correlations table and it is not clear from the example whether this comes from rounding 6.69 or from adding rounded weights (0+1+1+2+3=7).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, neither the WEIGHT statement nor the FREQ statement of PROC CORR can replicate the SPSS result, because the WEIGHT statement does not alter the &lt;EM&gt;n&lt;/EM&gt;&amp;nbsp;and the FREQ statement would truncate the fractional weights (hence use &lt;EM&gt;n&lt;/EM&gt;=0+0+1+1+2=4 in our example).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you need to compute the p-value based on the t distribution with, e.g, &amp;nbsp;6.69 - 2 = 4.69 degrees of freedom, you can simply add the weights and apply the code suggested above using the PROBT function (or the CDF function if you like).&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 11:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237143#M12569</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2015-12-01T11:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc corr two sided</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237144#M12570</link>
      <description>Great thanks so much i can use this work around</description>
      <pubDate>Tue, 01 Dec 2015 11:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-corr-two-sided/m-p/237144#M12570</guid>
      <dc:creator>timkill1982</dc:creator>
      <dc:date>2015-12-01T11:14:09Z</dc:date>
    </item>
  </channel>
</rss>

