<?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: Plot Date Interval in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Plot-Date-Interval/m-p/74142#M21474</link>
    <description>Hi:&lt;BR /&gt;
  I have 2 suggestions:&lt;BR /&gt;
1) post your question to the SAS/GRAPH and ODS GRAPHICS Forum&lt;BR /&gt;
 and&lt;BR /&gt;
2) read the documentation and run the examples for either&lt;BR /&gt;
---PROC GPLOT&lt;BR /&gt;
---PROC SGPLOT&lt;BR /&gt;
and pay close attention to the sample datasets that they use to illustrate their examples. If you compare the structure of the sample datasets to the structure of your data, then you will begin to understand whether your data is "plot-able" in the current structure or whether your data needs to be summarized and/or transformed in order to be plotted.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Wed, 22 Sep 2010 20:36:59 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-09-22T20:36:59Z</dc:date>
    <item>
      <title>Plot Date Interval</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Plot-Date-Interval/m-p/74141#M21473</link>
      <description>Hello,&lt;BR /&gt;
        I have data on days individuals perform an activity set up as follows:&lt;BR /&gt;
&lt;BR /&gt;
&lt;U&gt;Individual&lt;/U&gt;  &lt;U&gt;Start Date&lt;/U&gt;  &lt;U&gt;End Date&lt;/U&gt;   &lt;U&gt;Total Days &lt;/U&gt;&lt;BR /&gt;
          1              10/15/2005          10/18/2005            4                 &lt;BR /&gt;
          2              11/7/2005            11/30/2005            23 &lt;BR /&gt;
          3              12/1/2005            12/2/2005              2&lt;BR /&gt;
&lt;BR /&gt;
I would like to create a plot where along the x axis we have consecutive days and along the y axis the date interval the activity is being performed.  For each individual we would have a response of 1 on dates the activity takes place and 0 when it doesn't, then sum across all individuals for each day.  That is, if 20 individuals are active on 11/7, then the y-value is 20 etc.  Unfortunately, I am having trouble getting the data set up in a way to do this.  Does anybody have any suggestions?</description>
      <pubDate>Wed, 22 Sep 2010 20:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Plot-Date-Interval/m-p/74141#M21473</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-22T20:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Plot Date Interval</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Plot-Date-Interval/m-p/74142#M21474</link>
      <description>Hi:&lt;BR /&gt;
  I have 2 suggestions:&lt;BR /&gt;
1) post your question to the SAS/GRAPH and ODS GRAPHICS Forum&lt;BR /&gt;
 and&lt;BR /&gt;
2) read the documentation and run the examples for either&lt;BR /&gt;
---PROC GPLOT&lt;BR /&gt;
---PROC SGPLOT&lt;BR /&gt;
and pay close attention to the sample datasets that they use to illustrate their examples. If you compare the structure of the sample datasets to the structure of your data, then you will begin to understand whether your data is "plot-able" in the current structure or whether your data needs to be summarized and/or transformed in order to be plotted.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 22 Sep 2010 20:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Plot-Date-Interval/m-p/74142#M21474</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-09-22T20:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Plot Date Interval</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Plot-Date-Interval/m-p/74143#M21475</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
The following code does the job:&lt;BR /&gt;
&lt;BR /&gt;
data t;&lt;BR /&gt;
  input Individual StartDate date9. +1 EndDate date9. TotalDays;&lt;BR /&gt;
  format StartDate EndDate date9.;&lt;BR /&gt;
datalines; &lt;BR /&gt;
1 15Oct2005 18Oct2005 4 &lt;BR /&gt;
2 07Nov2005 30Nov2005 23 &lt;BR /&gt;
3 01Dec2005 02Dec2005 2&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data b;&lt;BR /&gt;
  set t;&lt;BR /&gt;
    do i=1 to TotalDays;&lt;BR /&gt;
      if i=1 then date=StartDate-1; &lt;BR /&gt;
      else  date+1;&lt;BR /&gt;
      activity=1;&lt;BR /&gt;
   output; &lt;BR /&gt;
   end; &lt;BR /&gt;
   format date date9.;&lt;BR /&gt;
run;&lt;BR /&gt;
proc SQL;&lt;BR /&gt;
  create table c as&lt;BR /&gt;
    select date, SUM(activity) as y&lt;BR /&gt;
    from b&lt;BR /&gt;
   group by date&lt;BR /&gt;
;quit;</description>
      <pubDate>Tue, 12 Oct 2010 15:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Plot-Date-Interval/m-p/74143#M21475</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-10-12T15:46:34Z</dc:date>
    </item>
  </channel>
</rss>

