BookmarkSubscribeRSS Feed
echoli
Obsidian | Level 7

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

boxplot.png

3 REPLIES 3
collinelliot
Barite | Level 11

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.

DanH_sas
SAS Super FREQ

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

echoli
Obsidian | Level 7

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?

 

GroupVar1Var2Var3Var4Var5Var6Var7Var8Var9
1251.996.918.824.94000.347717.45324
112.62.217.620.425.85380.30413.74692
111.62.768.725.221.46700.11634.21174
18.92.28821.819.43520.22699.95137
192.378.22319.44970.19728.32456
111.93.28.22423.63690.20096.2845
111.13.338.324.224.53320.19915.9978
16.83.299.729.117.22880.22366.80
17.13.199.82818.12250.22347344
115.22.57.822.622.33700.278511.1658
111.32.568.222.820.73240.19857.75113
111.62.437.520.627.84990.312612.8455
116.22.337.620.630.34630.32113.7537
216.42.757.521.626.85290.2519.120
216.92.77.12128.34550.294910.842
212.63.518.625.421.13910.26767.630
211.22.758.724.724.24550.406414.780
210.73.168.624.226.53700.4115130
212.92.637.521.235.55890.371814.130
211.22.77.822295130.385814.30
213.52.317.220.820.54270.20198.49170
210.63.4310.729.935.83090.23456.83 

 

Thanks,

Chen

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 3 replies
  • 643 views
  • 0 likes
  • 3 in conversation