- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear All,
I am trying to produce figure of Duration of AE for each subject.for this i have to producre the figrue in below layout
For this i have tried with Proc SGpannel.I have almost got the layout what i am looking for(as show above),but i need to draw a line for each point based on the stating and ending days of the each subjid.I have passed the annotated dataset for drawing the lines for each point,but not not succeded to get the desire result.
I am provding sample data and the code which i have tried.
Data data;
input subjid trtgrp $ aeout $11. start_day end_day aetoxcd subseq;
cards;
12 1 Resolved 143 143 1 1
27 1 Unresolved 255 256 1 2
143 1 Resolved 252 252 3 3
252 1 Resolved 392 395 1 4
417 1 Resolved 313 314 1 5
435 1 Resolved 428 435 1 6
443 1 Withdrwn 335 341 2 7
41 2 Resolved 170 171 1 1
55 2 Resolved 316 317 1 2
91 2 Withdrwn 432 432 2 3
133 2 Resolved 432 434 1 4
137 2 Resolved 369 370 1 5
141 3 Unresolved 393 428 1 1
144 3 Withdrwn 372 373 3 2
152 3 Resolved 141 142 1 3
154 3 Resolved 419 421 1 4
161 3 Resolved 304 305 1 5
;
run;
goptions reset = all ftext = swiss htitle = 5 htext = 3 gunit = pct
border cback = white hsize = 4in vsize = 4in;
data annotate;
set data;
length function style color $8;
retain xsys ysys hsys '3';
function='move'; x=start_day ; y=subseq; output;
function='draw'; color=black; line=1; size=1; x=end_day ; y=subseq; output;
run;
proc sgpanel data=data sganno=annotate;
panelby aetoxcd trtgrp / columns=1 spacing=5 novarname;
scatter X=end_day Y=subseq/group=aeout;
run;
I am getting above output but without line.So i need to draw a line based on the statr_day and end_day.
Could you please provied any solution for this.If you can provied any eample code,that would be greatefull.
Thanks in Advace.
Thanks in Advance,
Sanjeev.K
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try playing with this:
data haveGraph;
set have;
panel = catx(" ", aetoxcd, trtgrp);
run;
proc sgpanel data=haveGraph;
panelby panel / columns=1 onepanel novarname;
highlow y=subseq low=start_day high=end_day / type=bar barwidth=0.1 nooutline;
scatter X=end_day Y=subseq / group=aeout;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try playing with this:
data haveGraph;
set have;
panel = catx(" ", aetoxcd, trtgrp);
run;
proc sgpanel data=haveGraph;
panelby panel / columns=1 onepanel novarname;
highlow y=subseq low=start_day high=end_day / type=bar barwidth=0.1 nooutline;
scatter X=end_day Y=subseq / group=aeout;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You are mixing the annotation features between GPLOT and SGPLOT. SGPLOT or SGPANEL support annotation using the SGAnnotation format. Please see the doc for that. Also note, for SGPANEL, annotation can only be done on the whole graph, not per cell. Here is a recent paper:
https://support.sas.com/resources/papers/proceedings11/277-2011.pdf