Hi All,
I have a question here:
If I have 9 variables, I want each variable have one boxplot (all variables have different scales), but the final graph should be 9 cells in one panel. Like the draft graph below:
Any idea?
Thanks,
Chen
sgpanel is the proc you'll want. Look for the "onepanel" and "columns = 3" options to get what you want. Without knowing more about your data there's not much more I can tell you.
Since you are trying to create 9 truly-independent plots, PROC SGPANEL won't work well for you (unless you want to compare them across a unioned scale). The best approach for this would probably be to define a 3 by 3 layout using ODS LAYOUT and generate each box plot using PROC SGPLOT. Let me know if you need more information on this.
Thanks!
Dan
Hi DanH,
I think you are right, they are independent plots and I don't need compare. I've attached my example dataset, could you give me more information?
Group | Var1 | Var2 | Var3 | Var4 | Var5 | Var6 | Var7 | Var8 | Var9 |
1 | 25 | 1.99 | 6.9 | 18.8 | 24.9 | 400 | 0.3477 | 17.45 | 324 |
1 | 12.6 | 2.21 | 7.6 | 20.4 | 25.8 | 538 | 0.304 | 13.74 | 692 |
1 | 11.6 | 2.76 | 8.7 | 25.2 | 21.4 | 670 | 0.1163 | 4.21 | 174 |
1 | 8.9 | 2.28 | 8 | 21.8 | 19.4 | 352 | 0.2269 | 9.95 | 137 |
1 | 9 | 2.37 | 8.2 | 23 | 19.4 | 497 | 0.1972 | 8.32 | 456 |
1 | 11.9 | 3.2 | 8.2 | 24 | 23.6 | 369 | 0.2009 | 6.28 | 45 |
1 | 11.1 | 3.33 | 8.3 | 24.2 | 24.5 | 332 | 0.1991 | 5.99 | 78 |
1 | 6.8 | 3.29 | 9.7 | 29.1 | 17.2 | 288 | 0.2236 | 6.8 | 0 |
1 | 7.1 | 3.19 | 9.8 | 28 | 18.1 | 225 | 0.2234 | 7 | 344 |
1 | 15.2 | 2.5 | 7.8 | 22.6 | 22.3 | 370 | 0.2785 | 11.16 | 58 |
1 | 11.3 | 2.56 | 8.2 | 22.8 | 20.7 | 324 | 0.1985 | 7.75 | 113 |
1 | 11.6 | 2.43 | 7.5 | 20.6 | 27.8 | 499 | 0.3126 | 12.84 | 55 |
1 | 16.2 | 2.33 | 7.6 | 20.6 | 30.3 | 463 | 0.321 | 13.75 | 37 |
2 | 16.4 | 2.75 | 7.5 | 21.6 | 26.8 | 529 | 0.251 | 9.12 | 0 |
2 | 16.9 | 2.7 | 7.1 | 21 | 28.3 | 455 | 0.2949 | 10.8 | 42 |
2 | 12.6 | 3.51 | 8.6 | 25.4 | 21.1 | 391 | 0.2676 | 7.63 | 0 |
2 | 11.2 | 2.75 | 8.7 | 24.7 | 24.2 | 455 | 0.4064 | 14.78 | 0 |
2 | 10.7 | 3.16 | 8.6 | 24.2 | 26.5 | 370 | 0.4115 | 13 | 0 |
2 | 12.9 | 2.63 | 7.5 | 21.2 | 35.5 | 589 | 0.3718 | 14.13 | 0 |
2 | 11.2 | 2.7 | 7.8 | 22 | 29 | 513 | 0.3858 | 14.3 | 0 |
2 | 13.5 | 2.31 | 7.2 | 20.8 | 20.5 | 427 | 0.2019 | 8.49 | 170 |
2 | 10.6 | 3.43 | 10.7 | 29.9 | 35.8 | 309 | 0.2345 | 6.83 |
Thanks,
Chen
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.