<?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: Box and whisker chart, how SAS computes box ends. in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972346#M18843</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/476687"&gt;@bmcohen36&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/476687"&gt;@bmcohen36&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;... using 4 data points: -53.8, -41.2, -27.0, and -26.5.&amp;nbsp; I would have expected the box would extend from the 2nd value to the 3rd value (...) With only 4 values, I would expect the median would divide the box evenly.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In addition to the five quantile definitions offered by SAS there are (at least) four more available in other common statistical software packages.&amp;nbsp;Of course, they can be implemented in SAS by programming: see Rick Wicklin's blog article &lt;A href="https://blogs.sas.com/content/iml/2017/05/24/definitions-sample-quantiles.html" target="_blank" rel="noopener"&gt;"Sample quantiles: A comparison of 9 definitions"&lt;/A&gt;&amp;nbsp;and the accompanying PROC IML code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, none of those nine definitions matches your expectations, even though defining the first, second and third quartile of your example data as x&lt;SUB&gt;0.25&lt;/SUB&gt;=-41.2, x&lt;SUB&gt;0.5&lt;/SUB&gt;=(-41.2-27.0)/2 and x&lt;SUB&gt;0.75&lt;/SUB&gt;=-27.0, respectively, would satisfy the criterion&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;at least 100&lt;EM&gt;p&lt;/EM&gt; percent of the sample values are less than or equal to x&lt;SUB&gt;&lt;EM&gt;p&lt;/EM&gt;&lt;/SUB&gt; and&lt;/LI&gt;
&lt;LI&gt;at least 100(1-&lt;EM&gt;p&lt;/EM&gt;) percent of the sample values are greater than or equal to x&lt;SUB&gt;&lt;EM&gt;p&lt;/EM&gt;&lt;/SUB&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;which is sometimes used to characterize sample&amp;nbsp;&lt;EM&gt;p&lt;/EM&gt;-quantiles x&lt;SUB&gt;&lt;EM&gt;p&lt;/EM&gt;&lt;/SUB&gt;&amp;nbsp;(0&amp;lt;&lt;EM&gt;p&lt;/EM&gt;&amp;lt;1). Note that, by this characterization,&amp;nbsp;all values in the interval [-53.8, -41.2] qualify as a first quartile and similarly all values in [-41.2, -27.0] as a median and all values in [-27.0, -26.5] as a third quartile. Hence, your definition would pick the &lt;EM&gt;upper&lt;/EM&gt; interval endpoint for the first quartile, the &lt;EM&gt;midpoint&lt;/EM&gt;&amp;nbsp;of the interval for the median and the &lt;EM&gt;lower&lt;/EM&gt; interval endpoint for the third quartile to make the definition unique. The default quantile definition in SAS, however, consistently uses the interval midpoints in these cases.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Aug 2025 16:19:38 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2025-08-08T16:19:38Z</dc:date>
    <item>
      <title>Box and whisker chart, how SAS computes box ends.</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972268#M18840</link>
      <description>&lt;P&gt;I am creating a box and whisker graph using 4 data points: -53.8, -41.2, -27.0, and -26.5.&amp;nbsp; I would have expected the box would extend from the 2nd value to the 3rd value and the bottom whisker would extend to the minimum value and the upper whisker would extend to the maximum value.&amp;nbsp; Below is the graph I created in SAS where the box extends to the midpoint between the 1st and 2nd value (-47.5) to the midpoint between the 3rd and 4th value (-26.75), but the whiskers extend to the minimum and maximum.&amp;nbsp; Any ideas why SAS is computing 1st and 3rd quartiles in this manner?&amp;nbsp; With only 4 values, I would expect the median would divide the box evenly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bmcohen36_1-1754574454354.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/108892i4C9176AE8422FE39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bmcohen36_1-1754574454354.png" alt="bmcohen36_1-1754574454354.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 14:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972268#M18840</guid>
      <dc:creator>bmcohen36</dc:creator>
      <dc:date>2025-08-07T14:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Box and whisker chart, how SAS computes box ends.</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972283#M18841</link>
      <description>&lt;P&gt;First a caveat: I don't&amp;nbsp; use or have access to Visual Analytics&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS has different approaches for calculating percentiles depending on usage. I do not that Proc Univariate, Proc SGPlot, Proc Boxplot and others use either a PCTLDEF= or PERCENTILE=&amp;nbsp; option with values from 1 to 5 to specify which approach is used. The boxes are drawn from the 25th to 75th percentiles. So which definition is used does impact the appearance of graphs. Similarly the median, 50th percentile,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 16:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972283#M18841</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-08-07T16:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Box and whisker chart, how SAS computes box ends.</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972289#M18842</link>
      <description>&lt;P&gt;For what its worth, PROC UNIVARIATE produces the same chart. I think that with just 4 data points, the quartile limits are not going to behave in any type of intuitive way. And I don't think your statement "&lt;SPAN&gt;With only 4 values, I would expect the median would divide the box evenly" is a correct statement. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyway, the PROC UNIVARIATE documentation explains exactly how the percentiles are computed.&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/procstat/procstat_univariate_details14.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/procstat/procstat_univariate_details14.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm guessing your real data has a lot more than 4 data points. Am I correct? If so, does the boxplot on the real data look more intuitively correct?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 18:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972289#M18842</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-08-07T18:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Box and whisker chart, how SAS computes box ends.</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972346#M18843</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/476687"&gt;@bmcohen36&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/476687"&gt;@bmcohen36&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;... using 4 data points: -53.8, -41.2, -27.0, and -26.5.&amp;nbsp; I would have expected the box would extend from the 2nd value to the 3rd value (...) With only 4 values, I would expect the median would divide the box evenly.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In addition to the five quantile definitions offered by SAS there are (at least) four more available in other common statistical software packages.&amp;nbsp;Of course, they can be implemented in SAS by programming: see Rick Wicklin's blog article &lt;A href="https://blogs.sas.com/content/iml/2017/05/24/definitions-sample-quantiles.html" target="_blank" rel="noopener"&gt;"Sample quantiles: A comparison of 9 definitions"&lt;/A&gt;&amp;nbsp;and the accompanying PROC IML code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, none of those nine definitions matches your expectations, even though defining the first, second and third quartile of your example data as x&lt;SUB&gt;0.25&lt;/SUB&gt;=-41.2, x&lt;SUB&gt;0.5&lt;/SUB&gt;=(-41.2-27.0)/2 and x&lt;SUB&gt;0.75&lt;/SUB&gt;=-27.0, respectively, would satisfy the criterion&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;at least 100&lt;EM&gt;p&lt;/EM&gt; percent of the sample values are less than or equal to x&lt;SUB&gt;&lt;EM&gt;p&lt;/EM&gt;&lt;/SUB&gt; and&lt;/LI&gt;
&lt;LI&gt;at least 100(1-&lt;EM&gt;p&lt;/EM&gt;) percent of the sample values are greater than or equal to x&lt;SUB&gt;&lt;EM&gt;p&lt;/EM&gt;&lt;/SUB&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;which is sometimes used to characterize sample&amp;nbsp;&lt;EM&gt;p&lt;/EM&gt;-quantiles x&lt;SUB&gt;&lt;EM&gt;p&lt;/EM&gt;&lt;/SUB&gt;&amp;nbsp;(0&amp;lt;&lt;EM&gt;p&lt;/EM&gt;&amp;lt;1). Note that, by this characterization,&amp;nbsp;all values in the interval [-53.8, -41.2] qualify as a first quartile and similarly all values in [-41.2, -27.0] as a median and all values in [-27.0, -26.5] as a third quartile. Hence, your definition would pick the &lt;EM&gt;upper&lt;/EM&gt; interval endpoint for the first quartile, the &lt;EM&gt;midpoint&lt;/EM&gt;&amp;nbsp;of the interval for the median and the &lt;EM&gt;lower&lt;/EM&gt; interval endpoint for the third quartile to make the definition unique. The default quantile definition in SAS, however, consistently uses the interval midpoints in these cases.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 16:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Box-and-whisker-chart-how-SAS-computes-box-ends/m-p/972346#M18843</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-08-08T16:19:38Z</dc:date>
    </item>
  </channel>
</rss>

