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

Hi I have to do a boxplot with category "Visits". I want to connect boxes of those visits by mean except one visit "End Of Treatment". So it should be like all visits=boxes are connected by line (mean) and there is one box=EOT that is not. Is it possible ?

 

proc sgplot data=lb3 dattrmap=attrmap ;

vbox result/category=visit connect=mean FILLATTRS=red attrid=hybrid meanattrs=(symbol=circle ) whiskerattrs=(pattern=mediumdash);

xaxis label="Timepoint" ;
Yaxis values=(0 to 30 by 2) ;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

I haven't tried this, but the doc says you can overlay box plots as long as you have same category variable.  So, I suggest you can have two analysis variable columns A & B.  A should have analysis data missing for last category, while B should have data only for the last category.  Then, use VBOX with connect with A and a separate VBOX for B.  Both should have the same category variable.  This will avoid the need to compute the mean values.

 

If this does not work, you can use the methods described in this blog article to overlay custom connect line.

https://blogs.sas.com/content/graphicallyspeaking/2015/12/04/boxplot-with-connect/

 

https://blogs.sas.com/content/graphicallyspeaking/2015/12/06/boxplot-with-connect-using-annotate/

View solution in original post

2 REPLIES 2
GraphGuy
Meteorite | Level 14

Do you have any example data we can use to experiment with?

The line you're wanting could be drawn with sganno (annotate).

 

Jay54
Meteorite | Level 14

I haven't tried this, but the doc says you can overlay box plots as long as you have same category variable.  So, I suggest you can have two analysis variable columns A & B.  A should have analysis data missing for last category, while B should have data only for the last category.  Then, use VBOX with connect with A and a separate VBOX for B.  Both should have the same category variable.  This will avoid the need to compute the mean values.

 

If this does not work, you can use the methods described in this blog article to overlay custom connect line.

https://blogs.sas.com/content/graphicallyspeaking/2015/12/04/boxplot-with-connect/

 

https://blogs.sas.com/content/graphicallyspeaking/2015/12/06/boxplot-with-connect-using-annotate/

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 430 views
  • 0 likes
  • 3 in conversation