BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kuridisanjeev
Quartz | Level 8

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

 

fig.png

 

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;

req.jpg

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

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;
PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

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;
PG
Jay54
Meteorite | Level 14

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

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1080 views
  • 1 like
  • 3 in conversation