Data visualization with SAS programming

How to create graph with Adverse Events per each subject in each treatment side by side

Reply
New Contributor
Posts: 3

How to create graph with Adverse Events per each subject in each treatment side by side

I need help in generating graph by using GTL. My requirement is to create two graphs (one for each treatment) and they should be side by side (Please see attachment - Requirement.docx).

 

Study duration is on X-axis and subject number will be on Y-axis. I created this output by using proc gplot and PROC GREPLAY. First created two individual plots by using PROC GPLOT and used PROC GREPLAY to get two graphs onto single page side by side. 

 

I tried to get this graph by using PROC SGPANEL. with this procedure all the subject numbers from both treatment groups are present on Y-axis and second treatment subject numbers on the top and first treatment subject numbers are below (please see the attachment - sgpanel output).

SAS code I have used for the scatter plot as below:


proc sgpanel data=ae ;
panelby trt01pn sort/ layout=lattice;
scatter x=dur y=subjid;
run;

 

Sample data is provided in aegraph.xls 

SAS Super FREQ
Posts: 1,265

Re: How to create graph with Adverse Events per each subject in each treatment side by side

You will need to process the data to get SAS date variables.  See Adverse Event Timeline article for ideas on how to do this.

New Contributor
Posts: 3

Re: How to create graph with Adverse Events per each subject in each treatment side by side

Posted in reply to Sanjay_SAS

Thanks for your reply Sanjay. 

 

I think I am not clear with my question.

 

My main concern  is to get the two panels side by side with subject numbers on each y-axis (similar to Requirement.docx). In the SGPANEL output all subject are present on single y-axis on the left side with second treatment subjects on the top and below first treatment subjects. I want two graphs with subject numbers on the y-axis and the values (highlow plot or scatter plot) on each of them side by side not on one above the other.  

 

This can be done by SGPANEL or not.

 

All other lines can be done using high low plot will come in next step.

 

Thanks

Vijaya

SAS Super FREQ
Posts: 1,265

Re: How to create graph with Adverse Events per each subject in each treatment side by side

Yes, you can use SGPANEL to get a panel of adverse event graphs by some classifier.  That is the easy part.  You have to massage the data and use the right plots statements and options to get the appropriate graph in each cell.

New Contributor
Posts: 3

Re: How to create graph with Adverse Events per each subject in each treatment side by side

Posted in reply to Sanjay_SAS

Hi Sanjay, I tried different options provided in the SAS documentation and not able to get the graphs with different y-axis as my requirement and there are no examples available with similar case. Is there any post or example available from your blog, can you share it with me.

Ask a Question
Discussion stats
  • 4 replies
  • 117 views
  • 0 likes
  • 2 in conversation