BookmarkSubscribeRSS Feed
shari
Calcite | Level 5
Hi All,
Below is the data I have. I am trying to plot the median line plot with q1 and q3 for each armcd group for each visit. I am able to get the result i wanted but in three different figures for three different armcds. I want to see all the three armcd groups plots in a single figure. Is there any way to do that. Please let me know. 
 
data stats;
  input @1 avisit $10. @9 avisitn armn armcd $ median q1 q3;
  datalines; 
Baseline  0 60 DummyA 5639 2909 7221.5
Baseline  0 70 DummyB 3876 2929 6587
Baseline  0 80 DummyC 5112 3284 6686
Week1     12 60 DummyA 3304 1961 6157.5
Week12   12 70 DummyB 3496 1717 5021.5
Week12   12 80 DummyC 4266.5 3436 6504.5
Week26   26 60 DummyA 3762 2409 6233
Week26   26 70 DummyB 4377 3380 6735
Week26   26 80 DummyC 4261 3242 6084
;
run;
 
data reshape;                                                                                                      
   set stats;                                                                                                                        
   yvar=median;
   output;
   yvar=q1;                                                                                                                  
   output;                                                                                                                              
   yvar=q3;                                                                                                                  
   output;                                                                                                                              
run;                                                                                                                                    
 
/* Define the axis characteristics */
   axis1 offset=(5,5) minor=none order=(0 12 26);                                                                                            
/* Define the symbol characteristics */
   symbol1 interpol=hiloctj color=blue line=2;                                                                                          
   symbol2 interpol=none color=blue value=dot height=1.5;
 
proc sort data = reshape; by armcd; run;
 
proc gplot data=reshape;
   by armcd;
   plot yvar*avisitn median*avisitn / overlay haxis=axis1 vaxis=axis2;     
run;                                                                                                                                    
quit;  
1 REPLY 1
DanH_sas
SAS Super FREQ

I think you had a duplicate post. I posted a possible solution here: https://communities.sas.com/t5/Graphics-Programming/Line-plot-of-median-with-IQR/m-p/608758#M19175

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 300 views
  • 0 likes
  • 2 in conversation