<?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: Histogram does not reflect summary statistics. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746515#M10008</link>
    <description>&lt;P&gt;It may be (in fact I'm pretty sure) that 0 is the mode, but because of the way the bins are grouped together for plotting it doesn't look like 0 is the mode in the plot. In other words, the plot is misleading you. However, there are options in the HISTOGRAM statement that let you change the way the bins are grouped.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/procstat/procstat_univariate_syntax09.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/procstat/procstat_univariate_syntax09.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jun 2021 17:07:36 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-06-08T17:07:36Z</dc:date>
    <item>
      <title>Histogram does not reflect summary statistics.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746514#M10007</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Based on the summary statistics using, the mode is 0. In that case, shouldn't the histogram reflect 0 as the highest frequency?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*summary stats;
proc means data= libref.data2 mean std var min max n median mode;
run;

*histogram;
proc univariate data= libref.data2;
histogram;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WhatsApp Image 2021-06-09 at 00.24.34.jpeg" style="width: 446px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60135i73AF0F455148AFD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="WhatsApp Image 2021-06-09 at 00.24.34.jpeg" alt="WhatsApp Image 2021-06-09 at 00.24.34.jpeg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WhatsApp Image 2021-06-09 at 00.25.20.jpeg" style="width: 445px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60136iB2A6B8522A227C90/image-size/large?v=v2&amp;amp;px=999" role="button" title="WhatsApp Image 2021-06-09 at 00.25.20.jpeg" alt="WhatsApp Image 2021-06-09 at 00.25.20.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 17:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746514#M10007</guid>
      <dc:creator>karenktq</dc:creator>
      <dc:date>2021-06-08T17:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram does not reflect summary statistics.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746515#M10008</link>
      <description>&lt;P&gt;It may be (in fact I'm pretty sure) that 0 is the mode, but because of the way the bins are grouped together for plotting it doesn't look like 0 is the mode in the plot. In other words, the plot is misleading you. However, there are options in the HISTOGRAM statement that let you change the way the bins are grouped.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/procstat/procstat_univariate_syntax09.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/procstat/procstat_univariate_syntax09.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 17:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746515#M10008</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-06-08T17:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram does not reflect summary statistics.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746518#M10009</link>
      <description>The histogram bins data. So your binned data is more frequent than the mode but those are not the same measures so you're not comparing apples to apples. &lt;BR /&gt;&lt;BR /&gt;Ie Mode is single most frequent value but each bar is showing values within a range, ie 0 to 0.9&lt;BR /&gt;&lt;BR /&gt;The Bar @ 50 for example could be 50-50.9 which likely includes more values than just 50.0 &lt;BR /&gt;</description>
      <pubDate>Tue, 08 Jun 2021 17:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746518#M10009</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-08T17:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram does not reflect summary statistics.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746694#M10010</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/293903"&gt;@karenktq&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These kind of "hairy" histograms typically occur when &lt;EM&gt;discrete&lt;/EM&gt; data are binned inappropriately. In your example the default binning was inappropriate. I assume that your &lt;FONT face="courier new,courier"&gt;popularity&lt;/FONT&gt; values are integers. Note that apparently &lt;EM&gt;six&lt;/EM&gt; consecutive values went into &lt;EM&gt;five&lt;/EM&gt; bins. Thus, one of the five bins necessarily contains &lt;EM&gt;two&lt;/EM&gt; values, not one as the other four, and therefore "stands out" in the histogram, easily rising above the true mode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example demonstrating the issue and showing how the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_univariate_syntax09.htm#procstat.univariate.hist_midpoints" target="_blank" rel="noopener"&gt;MIDPOINTS= option&lt;/A&gt; can be used to obtain appropriate (or, if misused, inappropriate) binning:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
call streaminit(314159);
do _n_=1 to 50000;
  x=rand('poisson',160)-107;
  output;
end;
run;

ods graphics on;

proc univariate data=test;
histogram / midpoints=0 to 100 by 1.2 odstitle='Inappropriate Binning';
histogram / midpoints=0 to 100 odstitle='Appropriate Binning';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Inappropriate_Binning.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60176iF0A15AA14DFC0708/image-size/large?v=v2&amp;amp;px=999" role="button" title="Inappropriate_Binning.png" alt="Inappropriate_Binning.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Appropriate_Binning.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60177iE452502F61244AF1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Appropriate_Binning.png" alt="Appropriate_Binning.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 09:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746694#M10010</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-06-09T09:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram does not reflect summary statistics.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746724#M10011</link>
      <description>&lt;P&gt;You ignore the important element : the width of BIN .&lt;/P&gt;
&lt;P&gt;Change it by ENDPOINT= option , you would get different result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods select histogram;
proc univariate data=score_card ;
var total_score;
histogram total_score/ kernel &lt;STRONG&gt;endpoints=(490 to 650 by 10)&lt;/STRONG&gt;  ;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Jun 2021 12:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Histogram-does-not-reflect-summary-statistics/m-p/746724#M10011</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-06-09T12:43:51Z</dc:date>
    </item>
  </channel>
</rss>

