<?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 COMPARE - Table of summary statistics - Please explain formula (ystat-xstat)/x*100 in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978374#M49053</link>
    <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hi,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Could someone please explain the formula "&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ystat&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;xstat&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;100"&amp;nbsp;&lt;FONT color="#000000"&gt;present in the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1jbbrf1tztya8n1tju77t35dej9.htm" target="_self"&gt;PROC COMPARE documentation, under Results&lt;/A&gt;?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token number"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token number"&gt;&lt;FONT color="#000000"&gt;Especially, I would like to know what the single "x" in the denominator and the "xstat" and "ystat" in the numreator represents.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token number"&gt;&lt;FONT color="#000000"&gt;Cheers,&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token number"&gt;&lt;FONT color="#000000"&gt;Multippla99&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Nov 2025 12:21:48 GMT</pubDate>
    <dc:creator>Multipla99</dc:creator>
    <dc:date>2025-11-05T12:21:48Z</dc:date>
    <item>
      <title>PROC COMPARE - Table of summary statistics - Please explain formula (ystat-xstat)/x*100</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978374#M49053</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Hi,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Could someone please explain the formula "&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ystat&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;xstat&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;x&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;100"&amp;nbsp;&lt;FONT color="#000000"&gt;present in the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1jbbrf1tztya8n1tju77t35dej9.htm" target="_self"&gt;PROC COMPARE documentation, under Results&lt;/A&gt;?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token number"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token number"&gt;&lt;FONT color="#000000"&gt;Especially, I would like to know what the single "x" in the denominator and the "xstat" and "ystat" in the numreator represents.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token number"&gt;&lt;FONT color="#000000"&gt;Cheers,&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token number"&gt;&lt;FONT color="#000000"&gt;Multippla99&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 12:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978374#M49053</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2025-11-05T12:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC COMPARE - Table of summary statistics - Please explain formula (ystat-xstat)/x*100</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978400#M49054</link>
      <description>&lt;P&gt;Interesting.&amp;nbsp; I had assumed that formula was explaining that %Diff is calculated from the difference between the statistics from the BASE dataset and the COMPARE dataset.&amp;nbsp; But running a little example, I can't make much sense of the results.&amp;nbsp; For example, why does it indicate a difference of 1 for the MAX statistic, when the MAX is the same for both datasets?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class ;
  set sashelp.class ;
  if name='Alfred' then height=70 ;
run ;

proc compare base=sashelp.class compare=class allstats ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1762352481845.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111184iF6B198E751FA07EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1762352481845.png" alt="Quentin_0-1762352481845.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 14:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978400#M49054</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-11-05T14:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: PROC COMPARE - Table of summary statistics - Please explain formula (ystat-xstat)/x*100</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978401#M49055</link>
      <description>&lt;P&gt;Because 1.00 is the MAX of the DIFF.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 14:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978401#M49055</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-11-05T14:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC COMPARE - Table of summary statistics - Please explain formula (ystat-xstat)/x*100</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978402#M49056</link>
      <description>&lt;P&gt;The following paper may help beginning with Example 6 on page 13:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings10/149-2010.pdf" target="_self"&gt;https://support.sas.com/resources/papers/proceedings10/149-2010.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It says:&lt;/P&gt;
&lt;P&gt;Under the Diff and %Diff columns these statistics refer to the paired differences&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 14:41:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978402#M49056</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-11-05T14:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: PROC COMPARE - Table of summary statistics - Please explain formula (ystat-xstat)/x*100</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978723#M49070</link>
      <description>Thank you, Kathryn! I will read the paper and see if I get an explanation there.</description>
      <pubDate>Wed, 12 Nov 2025 12:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978723#M49070</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2025-11-12T12:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC COMPARE - Table of summary statistics - Please explain formula (ystat-xstat)/x*100</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978866#M49071</link>
      <description>&lt;P&gt;Thank you Kathryn!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have now read the recomended parts of the paper and it is obvious that the author knows what this is about. However, I still miss the complete exact definition of how DIFF and&amp;nbsp; %DIFF are calculated for the the different statistics, .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Multipla99&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 12:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978866#M49071</guid>
      <dc:creator>Multipla99</dc:creator>
      <dc:date>2025-11-14T12:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: PROC COMPARE - Table of summary statistics - Please explain formula (ystat-xstat)/x*100</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978868#M49072</link>
      <description>&lt;P&gt;My understanding (after reading the paper and Tom's explanation) is that PROC COMPARE calculates Diff&amp;nbsp; for each record as the difference between the two values, and DiffPct is that difference divided by the value in the Base dataset.&amp;nbsp; &amp;nbsp;So it's the Diff and % DIff you see in the usual Value Comparison Results.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then the summary stats are summaries of those variables , Diff and DiffPct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below uses the PROC COMPARE example I posted, and uses a DATA step to calculated Diff and DiffPCT and PROC MEANS to calculate the summary statistics.&amp;nbsp; This is the simple case, where all rows match.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class ;
  set sashelp.class ;
  if name='Alfred' then height=70 ;
run ;

proc compare base=sashelp.class compare=class allstats ;
run ;

data want ;
  merge sashelp.class (keep=Name Height rename=(Height=Height_base))
        class (keep=Name Height rename=(Height=Height_comp))
  ;
  by name ;
  diff=Height_comp-Height_base ;
  diffpct=diff/Height_base ;
run ;

proc means data=want n mean std max min stderr t probt;
  var diff diffpct ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm a big fan of PROC COMPARE, but have never used these stats.&amp;nbsp; I can see how N, MIN and MAX could be useful summary information.&amp;nbsp; Especially in the case of a big dataset that has lots of small differences due to numeric precision or whatever.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 13:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-COMPARE-Table-of-summary-statistics-Please-explain-formula/m-p/978868#M49072</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-11-14T13:33:31Z</dc:date>
    </item>
  </channel>
</rss>

