<?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: Odd Behavior From Proc Univariate in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/253167#M56882</link>
    <description>&lt;P&gt;For an explanation of histogram binning and how to set bins in PROC UNIVARIATE, see the article &lt;A href="http://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms.html" target="_self"&gt;"Choosing bins for histograms in SAS."&lt;/A&gt;&amp;nbsp; You can use the MIDPOINTS= option or the ENDPOINTS= option.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Feb 2016 12:54:58 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-02-29T12:54:58Z</dc:date>
    <item>
      <title>Odd Behavior From Proc Univariate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252585#M56840</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to use Proc Univariate to create some histograms, using the "endpoints" functionality to create my bins; however for some reason it seems to be extending the endpoints beyond the largest amount in my data...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So my in my data I have a variable ("percent_dif", which I am using to create the histograms) which is bound by 0 and 100; even though it is known to be bound by 0 and 100, I check for this by even running the following check on the data&amp;amp;colon;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data acct_data_test;
&amp;nbsp; &amp;nbsp; set acct_data;
&amp;nbsp; &amp;nbsp; if percent_dif &amp;lt; 0 or percent_dif &amp;gt; 100 or missing(percent_dif);
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it returns an empty dataset. I also added a where clause to proc univariate:&lt;/P&gt;
&lt;PRE&gt;proc univariate data=acct_data;
 &lt;STRONG&gt;   where percent_dif &amp;lt; 100;&lt;/STRONG&gt;
    var percent_dif;
    histogram percent_dif / endpoints=(0 to 100 by 5) 
    barlabel=percent outhist=BinCount;
run;&lt;/PRE&gt;
&lt;P&gt;However when I run the code, I get the following warning: "&lt;EM&gt;WARNING: The ENDPOINTS= list was extended to accommodate the data.&lt;/EM&gt;". And then it shows a histogram bar with values above 100:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2051iDC3DED99C86E3972/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="univariate histogram" title="univariate histogram" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the 0.048 above 100 and below 105...I'm at a loss for how this could be happening..Does anyone have any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 00:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252585#M56840</guid>
      <dc:creator>AllSoEasy</dc:creator>
      <dc:date>2016-02-26T00:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Odd Behavior From Proc Univariate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252588#M56841</link>
      <description>&lt;P&gt;It will increase itself after that Do Loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; histogram percent_dif / endpoints=(0 to &lt;STRONG&gt;95 &lt;/STRONG&gt;by 5) &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 00:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252588#M56841</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-26T00:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Odd Behavior From Proc Univariate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252592#M56842</link>
      <description>&lt;P&gt;That works! Awesome haha, thank you for the simple solution. I am still curious though, do we know why it was increasing past 100, if nothing was actually greater than 100?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But thank you again.&lt;/P&gt;
&lt;P&gt;-Ryan&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 01:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252592#M56842</guid>
      <dc:creator>AllSoEasy</dc:creator>
      <dc:date>2016-02-26T01:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Odd Behavior From Proc Univariate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252594#M56843</link>
      <description>&lt;P&gt;It has nothing to do with the original value in your dataset.&lt;/P&gt;
&lt;P&gt;It is just a SAS Syntax . After that loop it will plus 5 by itself .&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 01:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252594#M56843</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-26T01:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Odd Behavior From Proc Univariate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252659#M56847</link>
      <description>&lt;P&gt;The effect you describe is due to the logic of "binning". The final cell is from 95 to less than 100, the next is from 100 to less than 105. So, it looks like 0.048% of your data have values of 100.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To include 100 in the upper bin, use RTINCLUDE. See &lt;A href="http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_univariate_sect013.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_univariate_sect013.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Norman.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 05:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/252659#M56847</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2016-02-26T05:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Odd Behavior From Proc Univariate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/253167#M56882</link>
      <description>&lt;P&gt;For an explanation of histogram binning and how to set bins in PROC UNIVARIATE, see the article &lt;A href="http://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms.html" target="_self"&gt;"Choosing bins for histograms in SAS."&lt;/A&gt;&amp;nbsp; You can use the MIDPOINTS= option or the ENDPOINTS= option.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 12:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Odd-Behavior-From-Proc-Univariate/m-p/253167#M56882</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-02-29T12:54:58Z</dc:date>
    </item>
  </channel>
</rss>

