<?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: How do I create an Epi Curve with Proc sgplot? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154811#M5762</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Repost this under the Graphics community and then the SAS graphics guru will assist &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Aug 2014 19:55:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-08-08T19:55:20Z</dc:date>
    <item>
      <title>How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154810#M5761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dataset with case ID, classification status, disease, and symptom onset date. I want to create a graph where the x axis is onset date and the y axis is the number of cases with that onset date. I can manage to get a graph with the code below, but i want to include dates on the x axis even if there are no cases with that onset date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=cases;&lt;/P&gt;&lt;P&gt;vbar onset / group=classification_status;&lt;/P&gt;&lt;P&gt;xaxis label='Onset Date';&lt;/P&gt;&lt;P&gt;yaxis label='Number of Cases';&lt;/P&gt;&lt;P&gt;where disease='MEAS' and classification_status in ('CONFIRMED','DISCARD') and onset&amp;gt;19758 and onset&amp;lt;19800;&lt;/P&gt;&lt;P&gt;format onset mmddyy8.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SGPlot.png" class="jive-image-thumbnail jive-image jiveImage" src="https://communities.sas.com/legacyfs/online/7021_SGPlot.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also been able to use proc univariate to display a graph that includes onset dates with 0 cases, but I am unable to use a group statement to color the bars according to classification status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc univariate data=cases plot noprint;&lt;/P&gt;&lt;P&gt;var onset;&lt;/P&gt;&lt;P&gt;where disease='MEAS' and classification_status in ('CONFIRMED','DISCARD') and onset&amp;gt;19758 and onset&amp;lt;19900;&lt;/P&gt;&lt;P&gt;format onset mmddyy8.;&lt;/P&gt;&lt;P&gt;histogram / noframe vscale=count midpoints= 19759, 19760, 19761, 19762, 19763,...etc...19800;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="univar.png" class="jive-image-thumbnail jive-image jiveImage" src="https://communities.sas.com/legacyfs/online/7022_univar.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;so the first graph the first graph shows groups with different colors and the second graph shows dates with 0 counts. i want to have both in 1 chart!&lt;/P&gt;&lt;P&gt;also would like to extend the x axis or rotate the labels so the dates aren't all squished together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would appreciate any suggestions. thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 19:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154810#M5761</guid>
      <dc:creator>trbmph</dc:creator>
      <dc:date>2014-08-08T19:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154811#M5762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Repost this under the Graphics community and then the SAS graphics guru will assist &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 19:55:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154811#M5762</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-08-08T19:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154812#M5763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to show 0 or have no bar for the dates without any cases?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If no value you should be able to get that by adding a value list to your XAXIS definition like values=("15FEB2014"D to "17MAR2014"D by day)&lt;/P&gt;&lt;P&gt;Note: the date literals MUST be in the format above "ddMMMyy"d&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 21:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154812#M5763</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-08T21:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154813#M5764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was asked a similar question by another SAS user.&amp;nbsp; Here is the graph we came up with.&amp;nbsp; She wanted the data as a "stacked" bar, with two virus cases (V2 and W1) by week, but without overdrawing of the week values from one year to the next.&amp;nbsp; Note the X axis is over 2 years, with values by onset week.&amp;nbsp; Your EPI graph looks very similar to this.&amp;nbsp; See article at : &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2014/06/16/grouped-timeline/" title="http://blogs.sas.com/content/graphicallyspeaking/2014/06/16/grouped-timeline/"&gt;http://blogs.sas.com/content/graphicallyspeaking/2014/06/16/grouped-timeline/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above article used only week values 1-52, and a x axis of type TIME.&amp;nbsp; But actually there is a week 53 with only 1 or 2 days.&amp;nbsp;&amp;nbsp; Keeping all 53 weeks creates an overlap between the short 53rd week and week 1.&amp;nbsp; To address this, I redid the graph with a discrete x axis, and can likely go back to using a bar chart.&amp;nbsp; I will post article soon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7030" alt="ByYearWeek2_93.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/7030_ByYearWeek2_93.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 23:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154813#M5764</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2014-08-08T23:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154814#M5765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I worked on this graph to see if something better can be generated.&amp;nbsp; Some ideas are posted in a new article in the Graphically Speaking blog:&amp;nbsp; &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2014/08/09/epidemic-curve-graph/" title="http://blogs.sas.com/content/graphicallyspeaking/2014/08/09/epidemic-curve-graph/"&gt; Epidemic Curve Graph - Graphically Speaking&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Aug 2014 00:36:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154814#M5765</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2014-08-10T00:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154815#M5766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 22:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154815#M5766</guid>
      <dc:creator>trbmph</dc:creator>
      <dc:date>2015-01-09T22:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154816#M5767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's exactly what i'm looking for I think. So now I have &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=timeliness2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar event_dt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; title 'Epi Curve';&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis label='Event Date' values = ('01JAN2014'd to '31DEC2014'd by day) /*Horizontal axis*/;&lt;/P&gt;&lt;P&gt;&amp;nbsp; yaxis label='Number of Cases Investigated'&amp;nbsp; values = (0 to 10 by 1) /*Vertical axis*/;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the x axis is still all squished together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SGPlot6.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8653_SGPlot6.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;How can I space things out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 22:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154816#M5767</guid>
      <dc:creator>trbmph</dc:creator>
      <dc:date>2015-01-09T22:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154817#M5768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the category values are dates in chronological order, you might just want to thin them with a policy. Given the number of values, ROTATETHIN might be your best choice:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;xaxis fitpolicy=rotatethin;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 22:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154817#M5768</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2015-01-09T22:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154818#M5769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to show dates with 0 cases. The code below shows me everything except the dates with 0 cases. Also, I'm operating with SAS 9.2, otherwise i would try the high low statement. &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=disease1_mumps;&lt;/P&gt;&lt;P&gt;title 'Confirmed and Probable Mumps Cases, 2015';&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar event_date2 / barwidth=1 group=classification_status;&lt;/P&gt;&lt;P&gt;&amp;nbsp; xaxis label='Onset Date' values = ('01JAN2015'd to '13APR2015'd by day)&amp;nbsp; fitpolicy=rotatethin;&lt;/P&gt;&lt;P&gt;&amp;nbsp; yaxis label='Number of Cases' values = (0 to 10 by 1) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; where classification_status in ('Confirmed','Probable') and event_date2&amp;gt;='01JAN2015'd;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Apr 2015 18:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154818#M5769</guid>
      <dc:creator>trbmph</dc:creator>
      <dc:date>2015-04-13T18:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create an Epi Curve with Proc sgplot?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154819#M5770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems you are counting on the VBAR statement to compute the frequencies for date values.&amp;nbsp; If some dates are just not in the data, they will not be computed as zero frequencies.&amp;nbsp; They will be missing from the x axis.&amp;nbsp; However, the x-axis is discrete, so these missing date values will get compressed out.&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; Setting axis &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;values = ('01JAN2015'd to '13APR2015'd by day) &lt;/SPAN&gt;will not help.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Can you make your date variable as SAS time value and summarize the frequencies by date using proc MEANS in advance.&amp;nbsp; Then, you could then use a NEEDLE plot of frequency by Date (with a time format).&amp;nbsp; Now you will get the x axis as numeric (TIME) axis, with each value correctly positioned on each date, and missing dates will be spaced out. The clutter on the x axis will also go away. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Apr 2015 01:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-do-I-create-an-Epi-Curve-with-Proc-sgplot/m-p/154819#M5770</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-04-19T01:45:06Z</dc:date>
    </item>
  </channel>
</rss>

