<?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: Issues with Bins in Histogram in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301942#M16047</link>
    <description>&lt;PRE&gt;

data class;
 set sashelp.class end=last;
 output;
 if last then do;age=30;output;end;
run;

proc univariate data=class;
 var age;
 histogram age/ endpoints=(0 to 30 by 1) rtinclude ;
run;

&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Oct 2016 02:17:20 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-10-03T02:17:20Z</dc:date>
    <item>
      <title>Issues with Bins in Histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301929#M16044</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a newbie, who is using proc univariate to create a histogram but I'm having issues. My problem is that all the observations are bunched up under one bin/bar.&amp;nbsp;Can anyone please guide me what could be the issue? Thank you in advance for your help!&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Saulat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;========&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I'm trying to create a histogram for a variable "promtime", which has a range of 0 to 14034. However, the value 14034 is an outlier and if I exclude that, the range is 0 to 39. I tried to do that via "endpoints" option in the "histogram" statement but it doesn't work.&lt;/LI&gt;&lt;LI&gt;My code is below. I suspect that the "goptions" statement is causing problems but not sure about that.&lt;/LI&gt;&lt;LI&gt;The output of the "proc freq" and histogram chart are attached.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;***Temporary setting default values for graphics attributes***;&lt;BR /&gt;goptions reset=global /*Cancels all global statements */&lt;BR /&gt;gunit=pct /*Specifies the default unit of measure to be Percent, which to be used with height specifications.*/&lt;BR /&gt;hsize= 10.625 in /*Sets horizontal heigh of graphic area */&lt;BR /&gt;vsize= 8.5 in /*Sets vertical heigh of graphic area */&lt;BR /&gt;htitle=4 /*Selects the default height (default percent) used for the first TITLE line.*/&lt;BR /&gt;htext=3 /*Specifies the default height of the text in the graphics output. */&lt;BR /&gt;vorigin=0 in /*Sets vertical origin of graph */&lt;BR /&gt;horigin= 0 in /*Sets horizonal origin of graph */&lt;BR /&gt;cback=white border /*Background color of graph is set to white */&lt;BR /&gt;ctext=black /*Text color is black*/&lt;BR /&gt;colors=(black blue green red yellow) /*Specifies the foreground colors used to produce your graphics output*/&lt;BR /&gt;ftext=swiss /*Default font for all text*/&lt;BR /&gt;lfactor=3; /*Line Thickness */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***Check***;&lt;BR /&gt;proc freq data =Project1.Org ;&lt;BR /&gt;tables promtime;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate data=Project1.Org noprint;&lt;BR /&gt;histogram promtime&lt;BR /&gt;/ endpoints = 0 to 39;&lt;BR /&gt;run;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13018i1D636092255D874D/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="FrequencyTable - promtime variable.JPG" title="FrequencyTable - promtime variable.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13019i2F59F4C61717825B/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Histogram -promtime variable.JPG" title="Histogram -promtime variable.JPG" /&gt;</description>
      <pubDate>Mon, 03 Oct 2016 00:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301929#M16044</guid>
      <dc:creator>smajid</dc:creator>
      <dc:date>2016-10-03T00:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Bins in Histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301931#M16045</link>
      <description>&lt;P&gt;What does your log say?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exclude your outlier with a WHERE statement instead.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 00:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301931#M16045</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-03T00:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Bins in Histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301941#M16046</link>
      <description>&lt;PRE&gt;
1) specify step width.

data class;
 set sashelp.class end=last;
 output;
 if last then do;age=30;output;end;
run;

proc univariate data=class;
 var age;
 histogram age/ endpoints=(0 to 30 by 1) ;
run;


2) Your data is discrete not continuous, it is not good for Histogram, but for VBAR chart.

proc sgplot data=class;
 vbar age/ stat=percent;
run;


&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2016 02:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301941#M16046</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-03T02:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Bins in Histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301942#M16047</link>
      <description>&lt;PRE&gt;

data class;
 set sashelp.class end=last;
 output;
 if last then do;age=30;output;end;
run;

proc univariate data=class;
 var age;
 histogram age/ endpoints=(0 to 30 by 1) rtinclude ;
run;

&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2016 02:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301942#M16047</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-03T02:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Bins in Histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301955#M16048</link>
      <description>&lt;P&gt;ENDPOINTS &amp;amp; MIDPOINTS must cover the full interval otherwise SAS ignores it. There will be a message in the log to that effect.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, exclude your outliers with a WHERE statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Where variable&amp;lt; 10000;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2016 04:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/301955#M16048</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-03T04:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Bins in Histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/302039#M16054</link>
      <description>Oh wow, thanks, Reeza! The 'where statement' solution worked.&lt;BR /&gt;&lt;BR /&gt;I really appreciate your prompt response.</description>
      <pubDate>Mon, 03 Oct 2016 13:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/302039#M16054</guid>
      <dc:creator>smajid</dc:creator>
      <dc:date>2016-10-03T13:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Bins in Histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/302040#M16055</link>
      <description>Thanks, Ksharp! I tried Reeza's solution first, it solved the issue. But I sure will see if this works. Thanks a lot for your help too.&lt;BR /&gt;&lt;BR /&gt;I love SAS Communities!!</description>
      <pubDate>Mon, 03 Oct 2016 13:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Issues-with-Bins-in-Histogram/m-p/302040#M16055</guid>
      <dc:creator>smajid</dc:creator>
      <dc:date>2016-10-03T13:26:55Z</dc:date>
    </item>
  </channel>
</rss>

