<?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: Histograms - I can't get all the options I'd like in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154112#M8061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response.&amp;nbsp; For example, this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=Timing;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; histogram Number_of_Items / scale=count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; xaxis values=(70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100 102 104 106 108 110 112 114 116 118 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 120 122 124 126 128 130 132 134 136 138&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 140);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yaxis label='Frequency' min=0 max=1350;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xaxis label='Number of Items' min=70 max=140;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will give me the bins I specified, but the labels on the x-axis are 80, 100, 120 and 140.&amp;nbsp; This seems like a minor issue, and it is, but I need to exactly reproduce an existing report and so need the x-axis scale to read 70, 80, ..., 140. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It hadn't occurred to me to pre-calculate data.&amp;nbsp; If I make my own frequency counts, will SAS cooperate better graphing those?&amp;nbsp; Is there a term I can google or a link to code? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2014 15:01:06 GMT</pubDate>
    <dc:creator>DavidDew</dc:creator>
    <dc:date>2014-09-22T15:01:06Z</dc:date>
    <item>
      <title>Histograms - I can't get all the options I'd like</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154110#M8059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to generate histograms with three properties and I can't figure out how to do this.&amp;nbsp; It seems like each of proc univariate, sg plot, and gchart will give me two of the three properties, but none of them will give me all three.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to generate a histogram such that: 1) I can control the number of bins, 2) I can control which labels show up on the x-axis, 3) I can get a vertical reference line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have data that ranges from 70 to 140 inclusive and I'd like:&lt;/P&gt;&lt;P&gt;1) Bins by twos (70, 72, 74, ..., 138, 140)&lt;/P&gt;&lt;P&gt;2) Labels by 10s (70, 80, ..., 130, 140) where it's important that 70 and 140 are displayed&lt;/P&gt;&lt;P&gt;3) A vertical reference line at 100. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS seems to insist on either letting me set the number of bins but then SAS determines the numbers that are displayed on the x-axis, or SAS will let me choose the labels but then either uses those for the bins or determines its own number of bins. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions?&amp;nbsp; Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 12:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154110#M8059</guid>
      <dc:creator>DavidDew</dc:creator>
      <dc:date>2014-09-22T12:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms - I can't get all the options I'd like</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154111#M8060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SGPlot should allow you to do this, you may want to pre-calculate your data though&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you show your code for SG Plot that doesn't work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 14:36:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154111#M8060</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-22T14:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms - I can't get all the options I'd like</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154112#M8061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response.&amp;nbsp; For example, this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=Timing;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; histogram Number_of_Items / scale=count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; xaxis values=(70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100 102 104 106 108 110 112 114 116 118 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 120 122 124 126 128 130 132 134 136 138&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 140);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yaxis label='Frequency' min=0 max=1350;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xaxis label='Number of Items' min=70 max=140;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will give me the bins I specified, but the labels on the x-axis are 80, 100, 120 and 140.&amp;nbsp; This seems like a minor issue, and it is, but I need to exactly reproduce an existing report and so need the x-axis scale to read 70, 80, ..., 140. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It hadn't occurred to me to pre-calculate data.&amp;nbsp; If I make my own frequency counts, will SAS cooperate better graphing those?&amp;nbsp; Is there a term I can google or a link to code? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154112#M8061</guid>
      <dc:creator>DavidDew</dc:creator>
      <dc:date>2014-09-22T15:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms - I can't get all the options I'd like</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154113#M8062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the problem is simpler, you have 2 xaxis statements and the last one overwrites the first one. Combining them together produces the labels that you'd like.&lt;/P&gt;&lt;P&gt;Look at the refline statement to add a reference line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=Timing;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; histogram Number_of_Items / scale=count;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yaxis label='Frequency' min=0 max=1350;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xaxis label='Number of Items' min=70 max=140 values=(70 72 74 76 78 80 82 84 86 88 90 92 94 96 98&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100 102 104 106 108 110 112 114 116 118&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 120 122 124 126 128 130 132 134 136 138&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 140);;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154113#M8062</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-22T15:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms - I can't get all the options I'd like</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154114#M8063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a good theory, and probably part of the problem, but when I run your code the values shown on the x-axis change from 80, 100, 120, 140 in my old code to the values 70 through 138 inclusive, by 4s (70, 74, 78, ..., 134, 138).&amp;nbsp; So it still refuses to let me say that I want the x-axis to have tick marks at 70, 80, ..., 130, 140. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not clear to me if there's an easy way to do this or if I have to resort to templates, which I'm just learning, or if there is some other method.&amp;nbsp; It just seems like there would be independent and easy commands to specify one set of numbers for the bins and a different set for the values displayed on the x-axis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154114#M8063</guid>
      <dc:creator>DavidDew</dc:creator>
      <dc:date>2014-09-22T15:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms - I can't get all the options I'd like</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154115#M8064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, binstart and values are the separate commands I was looking for.&amp;nbsp; If one of them is missing, SAS is either using the command present for both roles or is making its own guess for the missing command.&amp;nbsp; In this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=Timing;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; histogram Number_of_Items / BINSTART = 70 BINWIDTH=2 scale=count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yaxis label='Frequency' min=0 max=1350;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xaxis label='Number of Items' min=70 max=140 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUES=(70 80 90 100 110 120 130 140);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; refline 100 /axis=x;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BINSTART and BINWIDTH control the number of bins SAS uses in its calculations and therefore the number of bars that appear in the histogram.&amp;nbsp; VALUES controls what is printed for labels on the x-axis.&amp;nbsp; In my other code I thought VALUES controlled the number of bins and with the long list of numbers I had there, there wasn't room for the 140 to print.&amp;nbsp; With this smaller list of values, 70 and 140 both print.&amp;nbsp; BINSTART and VALUES work independently of each other.&amp;nbsp; Finally, refline gives me my reference line.&amp;nbsp; Then goptions or templates get used to adjust fonts and such issues. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Reeza for your help.&amp;nbsp; You narrowed things down so that my google searches finally found the correct terms that then gave me the correct commands.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 15:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154115#M8064</guid>
      <dc:creator>DavidDew</dc:creator>
      <dc:date>2014-09-22T15:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Histograms - I can't get all the options I'd like</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154116#M8065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might find this overview helpful: &lt;A href="http://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms/" title="http://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms/"&gt; Choosing bins for histograms in SAS - The DO Loop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 17:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Histograms-I-can-t-get-all-the-options-I-d-like/m-p/154116#M8065</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-09-22T17:46:24Z</dc:date>
    </item>
  </channel>
</rss>

