<?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: Comparing rate values by group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900453#M355865</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you!That works !Could you explain please why you take the Median and not Mean ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In case of a heavily skewed distribution, the median (to me) is a better central tendency measure than the mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also check whether Max &amp;lt; (1.10*Min).&lt;/P&gt;
&lt;P&gt;This means you take the midpoint (halfway point between min and max) instead of median.&lt;/P&gt;
&lt;P&gt;I believe both midpoint and median are a better choice than mean for what you want to achieve.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;else if Invoice_Max &amp;lt; (1.10*Invoice_Min) then Commentaire='Taux égaux';
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Sat, 28 Oct 2023 19:46:54 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2023-10-28T19:46:54Z</dc:date>
    <item>
      <title>Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900447#M355861</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to taste if my rate (Taux) is equal +/- 5%. My code is&amp;nbsp; :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc means data=RP_EA7 noprint;
	class cle;
	var Taux;
	output out=RP_EA7_STAT stddev=stddev;
run;

data RP_EA8_STAT;
	length Commentaire $50;
	set RP_EA7_STAT;

	if _type_=0 then
		delete;

	if stddev&amp;lt;0.05 then
		Commentaire='Taux égaux';
	else if stddev=. then
		Commentaire='Une seule valeur';
	else Commentaire='Valeurs ne sont pas égaux’;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I think that STDDEV is not a good indicator (I would like to have a value +- 5%).&amp;nbsp; Do you know, please, another way to do this selection?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 17:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900447#M355861</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-10-28T17:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900450#M355863</link>
      <description>&lt;P&gt;Is this what you want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.cars nway noprint;
	class Make;
	var   Invoice;
	output out=RP_EA7_STAT min= median= max= / autoname;
run;

data RP_EA8_STAT;
	length Commentaire $50;
	set RP_EA7_STAT;
   *if _type_=0 then delete;
    if _FREQ_=1 then Commentaire='Une seule valeur';
	else if Invoice_Min &amp;gt; (0.95*Invoice_Median) and Invoice_Max &amp;lt; (1.05*Invoice_Median) 
                then Commentaire='Taux égaux';
	else             Commentaire='Valeurs ne sont pas égaux';
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 19:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900450#M355863</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-28T19:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900451#M355864</link>
      <description>&lt;P&gt;Thank you!That works !Could you explain please why ypu take the Median and not Mean ?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 19:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900451#M355864</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-10-28T19:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900453#M355865</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you!That works !Could you explain please why you take the Median and not Mean ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In case of a heavily skewed distribution, the median (to me) is a better central tendency measure than the mean.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also check whether Max &amp;lt; (1.10*Min).&lt;/P&gt;
&lt;P&gt;This means you take the midpoint (halfway point between min and max) instead of median.&lt;/P&gt;
&lt;P&gt;I believe both midpoint and median are a better choice than mean for what you want to achieve.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;else if Invoice_Max &amp;lt; (1.10*Invoice_Min) then Commentaire='Taux égaux';
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 19:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900453#M355865</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-28T19:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900455#M355867</link>
      <description>Thank you!</description>
      <pubDate>Sat, 28 Oct 2023 20:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900455#M355867</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-10-28T20:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900458#M355870</link>
      <description>&lt;P&gt;I have another question, Koen. Why you wrote : Max &amp;lt; (1.10*Min). Why do you use 1.10 ?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 20:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900458#M355870</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-10-28T20:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900463#M355871</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have another question, Koen. Why you wrote : Max &amp;lt; (1.10*Min). Why do you use 1.10 ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Because&amp;nbsp;&lt;SPAN&gt;+/- 5% around the midpoint (halfway point) is a range of 10%.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 21:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900463#M355871</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-28T21:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900465#M355872</link>
      <description>&lt;P&gt;Thank you ! Min=Midpoint in this case ?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 22:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900465#M355872</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-10-28T22:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900543#M355906</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you ! Min=Midpoint in this case ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No.&lt;BR /&gt;But midpoint minus 5% should contain MIN.&lt;BR /&gt;And midpoint plus 5% should contain MAX.&lt;/P&gt;
&lt;P&gt;That's (&lt;U&gt;almost&lt;/U&gt;!) the same as saying that MAX should be within 1.10 times MIN.&lt;/P&gt;
&lt;P&gt;That's (&lt;U&gt;almost&lt;/U&gt;!) the same as saying that MIN should be within 0.90 times MAX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want it exact, you need to calculate the exact midpoint between MIN and MAX and subsequently check whether MIN and MAX are &lt;BR /&gt;within the interval &lt;STRONG&gt;[0.95 * midpoint ;&amp;nbsp;1.05 * midpoint]&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2023 23:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/900543#M355906</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-10-29T23:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing rate values by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/901632#M356316</link>
      <description>Thank you Koen!</description>
      <pubDate>Sun, 05 Nov 2023 21:04:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-rate-values-by-group/m-p/901632#M356316</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2023-11-05T21:04:58Z</dc:date>
    </item>
  </channel>
</rss>

