<?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: Simple way to do histogram by dates in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/318447#M11163</link>
    <description>I think I would need to extract the datepart(). I was hoping the series chart could just do a frequency rather than another variable for Y.</description>
    <pubDate>Tue, 13 Dec 2016 04:22:24 GMT</pubDate>
    <dc:creator>SThomas</dc:creator>
    <dc:date>2016-12-13T04:22:24Z</dc:date>
    <item>
      <title>Simple way to do histogram by dates</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/317961#M11132</link>
      <description>&lt;P&gt;Here is my data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;group-var&lt;/TD&gt;&lt;TD&gt;datetime&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;09AUG2014:07:52:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;17JUL2014:19:32:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;30JUL2014:16:15:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;12JUL2014:07:02:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;12JUL2014:09:41:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&l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TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Is there a way to do either of the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) a simple set of histograms, one for each grouped_var, that adds up the number of observations for that group each month? (I would rather not type out each group_var, as there are more than just a,b, and c.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) a multiple series line chart that has a separate series for each grouped_var that shows the number of occurences of for each month?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I searched but couldn't find the answer, so thank you so much in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 18:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/317961#M11132</guid>
      <dc:creator>SThomas</dc:creator>
      <dc:date>2016-12-09T18:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to do histogram by dates</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/317964#M11133</link>
      <description>&lt;P&gt;What you are looking for is called a "comparative histogram," and searching on that term will lead you to many articles, including this summary article &lt;A href="http://blogs.sas.com/content/iml/2016/03/09/comparative-panel-overlay-histograms-sas.html" target="_self"&gt;"Comparative histograms: Panel and overlay histograms in SAS."&lt;/A&gt;&amp;nbsp; From your description, it sounds like you want to use the panel approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgpanel data=sashelp.iris;
  panelby group-var;
  histogram datetime;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might want to &lt;A href="http://support.sas.com/documentation/cdl/en/grstatproc/69716/HTML/default/viewer.htm#p0vyc21mth0jrtn1c4jimudemip4.htm" target="_self"&gt;add a COLAXIS statement and specify the INTERVAL= option&lt;/A&gt; to get axis ticks that are convenient for your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure what you mean by a "multiple time series chart" for this data. Look at the VLINE statement and the STAT=SUM option. However, I think you would need to bin the&amp;nbsp;data to the month level, probably by using a format. &amp;nbsp;Thus try starting with the following:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sgpanel data=A;
format datetime DTMONYY5.;
panelby groupvar;
vbar datetime / stat=sum;   /* I prefer VBAR */
vline datetime / stat=sum markers break;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 18:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/317964#M11133</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-12-09T18:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to do histogram by dates</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/317997#M11134</link>
      <description>&lt;P&gt;Pet peeve: DATES and DATETIMES are different, especially in SAS. So do you want dates or datetimes for your histogram?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What would be the Y variable for a series chart? You show a group variable and an x axis variable but a series is going to want something to show as a Y.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 20:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/317997#M11134</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-09T20:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simple way to do histogram by dates</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/318447#M11163</link>
      <description>I think I would need to extract the datepart(). I was hoping the series chart could just do a frequency rather than another variable for Y.</description>
      <pubDate>Tue, 13 Dec 2016 04:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-way-to-do-histogram-by-dates/m-p/318447#M11163</guid>
      <dc:creator>SThomas</dc:creator>
      <dc:date>2016-12-13T04:22:24Z</dc:date>
    </item>
  </channel>
</rss>

