BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AHW
Calcite | Level 5 AHW
Calcite | Level 5

Hi everyone,

 

I'm trying to create a box plot that considers frequencies (similar to how you can specify FREQ or WEIGHT in PROC MEANS). My data is grouped into 16 categories, where each one should have its own box. After going through the documentation, I haven't been able to find any options in the BOXPLOT procedure itself.

 

I've also tried to create a summary dataset using MEANS and then using it as a HISTORY dataset in the BOXPLOT procedure, but the format of the dataset doesn't match what is needed for a BOXPLOT.

 

If I could somehow rename the dataset, I'd imagine the code below would work:

 

PROC MEANS DATA=DISTANCE_BY_GROUP MIN P25 MEDIAN MEAN P75 MAX STD N;
	BY GROUP_NO;
	FREQ N_CLAIMS;
	OUTPUT OUT=SUMM_STATS;
RUN;

PROC BOXPLOT HISTORY=SUMM_STATS;
PLOT DISTANCE*GROUP_NO;
RUN;

Does anyone have any suggestions on how to handle this?

 

Thanks in advance!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Try something like this:

 

proc sgplot data=DISTANCE_BY_GROUP;
vbox your_analysis_var / category=GROUP_NO freq=N_CLAIMS;
run;

Hope this helps!

Dan

View solution in original post

1 REPLY 1
DanH_sas
SAS Super FREQ

Try something like this:

 

proc sgplot data=DISTANCE_BY_GROUP;
vbox your_analysis_var / category=GROUP_NO freq=N_CLAIMS;
run;

Hope this helps!

Dan

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1464 views
  • 2 likes
  • 2 in conversation