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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 186 views
  • 0 likes
  • 2 in conversation