Hi there!
Wondering if someone can assist me? One of my boxplot groups got switched (center one) and I'm unsure how to correct.
This is my code:
Proc sgplot data=box dattrmap=myattrmap;
vbox age /category=cat group=gender nooutliers attrid=gen;
Where Gender in ("Male", "Female");
Keylegend / location=inside position=bottom;
Xaxis display=(nolabel);
Yaxis values=(2 to 20 by 4) minor display=(nolabel);
Run;
Thank you!
On the PROC SGPLOT statement try using the GROUPORDER= option. Values are DATA, REVERSEDATA, ASCENDING, DESCENDING
What order is the data in BOX? Does it match the order you want or does it match the order you got?
On the PROC SGPLOT statement try using the GROUPORDER= option. Values are DATA, REVERSEDATA, ASCENDING, DESCENDING
That worked! Thank you :). To the printer!
Try adding the Grouporder=Ascending (or Descending) to the VBOX statement. That should make the order of the group values consistent.
@agille05 wrote:
Hi there!
Wondering if someone can assist me? One of my boxplot groups got switched (center one) and I'm unsure how to correct.
This is my code:
Proc sgplot data=box dattrmap=myattrmap; vbox age /category=cat group=gender nooutliers attrid=gen; Where Gender in ("Male", "Female"); Keylegend / location=inside position=bottom; Xaxis display=(nolabel); Yaxis values=(2 to 20 by 4) minor display=(nolabel); Run;
Thank you!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.