<?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: Plotting recurrent events in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-recurrent-events/m-p/594524#M18939</link>
    <description>&lt;P&gt;If your data was less dense, I would suggest using a HIGHLOW plot, like in Sanjay's post here (&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2013/01/30/ae-timeline-by-name/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2013/01/30/ae-timeline-by-name/&lt;/A&gt;). However, given the amount of data you have, you might want to do something like this (untested code below):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=ae_data noborder;
hbarparm ID / response = EventDate;
scatter y=ID x=EventDate / group = EventType;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2019 18:50:31 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2019-10-07T18:50:31Z</dc:date>
    <item>
      <title>Plotting recurrent events</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-recurrent-events/m-p/594518#M18938</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way to plot recurrent events? or What is the best way to plot adverse events. I am looking to create a plot like this.&lt;/P&gt;&lt;P&gt;May be one difference that adding two or more symbols for different types of recurrent events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data structure is very simple like this:&amp;nbsp;ID, EventNr, EventType, EventDate.&lt;/P&gt;&lt;P&gt;Event type can either be recurrent event, terminal event or study exit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="plot-reSurv-1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32999i0BD3CE05BE477219/image-size/large?v=v2&amp;amp;px=999" role="button" title="plot-reSurv-1.png" alt="plot-reSurv-1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 18:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-recurrent-events/m-p/594518#M18938</guid>
      <dc:creator>Ubai</dc:creator>
      <dc:date>2019-10-07T18:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting recurrent events</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-recurrent-events/m-p/594524#M18939</link>
      <description>&lt;P&gt;If your data was less dense, I would suggest using a HIGHLOW plot, like in Sanjay's post here (&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2013/01/30/ae-timeline-by-name/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2013/01/30/ae-timeline-by-name/&lt;/A&gt;). However, given the amount of data you have, you might want to do something like this (untested code below):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=ae_data noborder;
hbarparm ID / response = EventDate;
scatter y=ID x=EventDate / group = EventType;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 18:50:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-recurrent-events/m-p/594524#M18939</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-10-07T18:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting recurrent events</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-recurrent-events/m-p/594756#M18940</link>
      <description>&lt;P&gt;Here's one way to do it (I'm generating fake/random data, to be somewhat like the data in your graph)...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data my_patients (drop=id_num);&lt;BR /&gt;do id_num=1 to 100;&lt;BR /&gt;length id $10;&lt;BR /&gt;id=id_num;&lt;BR /&gt;time=ranuni(123)*2000;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=my_patients out=my_patients;&lt;BR /&gt;by descending time;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data my_patients; set my_patients;&lt;BR /&gt;events=round(10*ranuni(123));&lt;BR /&gt;do eventnr=1 to events;&lt;BR /&gt;eventtype='Recurrent Events';&lt;BR /&gt;eventdate=ranuni(123)*time;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;if ranuni(123)&amp;lt;.3 then do;&lt;BR /&gt;eventtype='Terminal Event';&lt;BR /&gt;eventdate=time;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data myattrmap;&lt;BR /&gt;id='scattersymbols';&lt;BR /&gt;length markersymbol value markercolor $50;&lt;BR /&gt;value='Recurrent Events'; markercolor='cx83a37b'; markersymbol='circlefilled'; output;&lt;BR /&gt;value='Terminal Event'; markercolor='red'; markersymbol='trianglefilled'; output;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title j=l "Recurrent Event Plot";&lt;BR /&gt;proc sgplot data=my_patients noborder dattrmap=myattrmap;&lt;BR /&gt;label id='Subject';&lt;BR /&gt;hbarparm category=id response=time / fillattrs=(color=graycc) outlineattrs=(color=gray99);&lt;BR /&gt;scatter y=id x=eventdate / group=eventtype attrid=scattersymbols;&lt;BR /&gt;yaxis display=(novalues noticks noline);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="event_graph.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33007i8616B8CDEB1206D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="event_graph.png" alt="event_graph.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 13:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-recurrent-events/m-p/594756#M18940</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2019-10-08T13:38:54Z</dc:date>
    </item>
  </channel>
</rss>

