BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jacksonan123
Lapis Lazuli | Level 10
TIME	STUDY	        MEAN	LCL	UCL
03hr	 REF03LT6	17.7	 14	21.3
03hr	 SIM03LT6	14.5	 14	14.6
36hr	 REF36LT6	19.3	 15	23.7
36hr	 SIM36LT6	18.5	  18	18.7
612hr REF612LT6	         33	26	40.6
612hr SIM612LT6	        39.4	 39	40
03hr	REF03GT6	20.6 	14	27
03hr	SIM03GT6	21	20.4	21.1
36hr	REF36GT6	28.4	 20	36.8
36hr	 SIM36GT6	19	18	19
612hr REF612GT6	       	33	26	41
612hr SIM612GT6		74	73	75

/*******************PREPARATION OF A HORIZONTAL CI PLOT****************/

proc import out=ALLCI
datafile='/folders/myfolders/PARTIALAUC_JUV/ALLJUVCI_age.CSV'
            dbms=csv replace;
            getnames=yes;
            datarow=2;
run;      

ods _all_ close;
ods html path='/folders/myfolders/PARTIALAUC_JUV/ ';
ods graphics/antialiasmax=1100;


Proc sgpanel data=allcI;
Panelby TIME STUDY/ columns=4 rows=3 uniscale=row;
Series x=lcl y=MEAN /lineattrs =(pattern=1 COLOR=RED THICKNESS=5)legendlabel='SIMLT6'; 
Series x=ucl y=MEAN /lineattrs =(pattern=5 COLOR=BLUE THICKNESS=5)legendlabel='REFLT6' ;
Series x=lcl y=MEAN /lineattrs =(pattern=2 COLOR=GREEN THICKNESS=10)legendlabel='SIMGT6'; 
Series x=ucl y=MEAN /lineattrs =(pattern=15 COLOR=BLACK THICKNESS=5)legendlabel='REFGT6' ;
rowaxis label='90% Confidence Interval Mean';
colaxis label= 'Range 90% Confidence Interval pAUC AGE';
/*%put _automatic_;*/
Run; 
ods html close;
ods listing;

When I run the data presented with the code I get the  desired graph except that lines are not drawn connecting the upper (UCL)and lower (LCL) confidence interval values and only two of the requested colors black and green are used for the plots.  Can some one tell me how to get the graphs to reflect the requested graph colors and how to have lines drawn to connect the LL and UL of the confidence intervals?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The reason the Upper and Lower values are not connecting is very simple: Series connects the values in each Series statement, not across multiple Series statements. So the UCL at time 03hr gets connected to  the UCL at 36hr.

View solution in original post

3 REPLIES 3
Reeza
Super User
I think you'll need to use SCATTER instead or a BAND statement to get what you want but that's just a guess.

SCATTER has an upper/lower options for error bars/CI. Are you trying to make a series of forest plots?

You're graphing the exact same series twice so not sure what you're expecting to happen there. I'm guessing the later statements override the earlier ones.

https://blogs.sas.com/content/graphicallyspeaking/2017/10/22/tips-tricks-segmented-discrete-axis/
Rick_SAS
SAS Super FREQ

I do not completely understand what graph you are trying to create, but the following makes a plot of the CIs. f it isn't what you want, perhaps it can point you in the right direction:

 

data allci;
length TIME $5 STUDY $9;
input TIME STUDY	 MEAN	LCL	UCL;
datalines;
03hr   REF03LT6       17.7    14    21.3
03hr   SIM03LT6       14.5    14    14.6
36hr   SIM36LT6       18.5    18    18.7
612hr  REF612LT6      33      26    40.6
612hr  SIM612LT6      39.4    39    40
03hr   REF03GT6       20.6    14    27
03hr   SIM03GT6       21      20.4  21.1
36hr   REF36GT6       28.4    20    36.8
36hr   SIM36GT6       19      18    19
612hr  REF612GT6      33      26    41
612hr  SIM612GT6      74      73    75
;

/* PREPARATION OF A HORIZONTAL CI PLOT */
proc sgpanel data=allci;
panelby study / columns=4 rows=3 uniscale=row;
scatter x=mean y=Time / xerrorlower=LCL xerrorupper=UCL;
rowaxis label='90% Confidence Interval Mean';
colaxis grid label= 'Range 90% Confidence Interval pAUC AGE';
run;
ballardw
Super User

The reason the Upper and Lower values are not connecting is very simple: Series connects the values in each Series statement, not across multiple Series statements. So the UCL at time 03hr gets connected to  the UCL at 36hr.

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
  • 3 replies
  • 392 views
  • 2 likes
  • 4 in conversation