The first three boxes are groups from the same sample while the last box is from a different sample entirely. Is it possible to keep this graph the same but have the line not connect to the last box? I used proc sgplot to generate the graph connecting on mean. Any help is much appreciated! Thank you in advance!
As a minimum the code used to create that graph would be helpful.
Since there are very few plots that can mix with the VBOX you may want to turn of the connection in VBOX and create an annotate data set to connect the 3 desired mean values for the categories.
Another option might be to have a different analysis variable for the "other" data and have two vbox statements. Make sure that the two analysis variables are only assigned for the appropriate category values.
An example with made up data to demonstrate principal:
do group= 1 to 3;
do i= 1 to 20;
y1 = rand('uniform');
/* clear for example data the y1*/
do i=1 to 20;
proc sgplot data=example;
vbox y1 / connect=mean category=group ;
vbox y2 / category=group;
Note that because the categories have missing values for the analysis variables you will get notes in the log about incomplete or invalid data and "some boxes will not be drawn".
You will likely want to suppress the legend, or modify it. By default the two sets of boxes are likely to also be in different colors.
I think the best option to display what you describe is to use a boxplot grouped by sample. Here is a little program to simulate the idea:
do x=1 to 4;
if x < 4 then samp=40;
do t=1 to 10;
proc sgplot data=sample;
vbox response / category=x group=samp groupdisplay=overlay connect=mean;
If you don't want the color change, the other option is to do as @ballardw suggested, and that was pre-compute the mean and overlay an annotated line or a SERIES plot.
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.