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!
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!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: