BookmarkSubscribeRSS Feed
denserro
Calcite | Level 5

I have been having issues with creating block groups in proc boxplot.

i.e. The example when I try to perform the following:

 

proc boxplot;

plot y*male (group);

run;

 

I keep getting an error message that the data is not properly sorted.  

 

NOTE: Processing beginning for PLOT statement number 1.
ERROR: The values of the group variable male are not sorted in increasing order in the data set
POOLED.
NOTE: Recommended practice is to sort the data by the group variable (within BY groups if any)
with PROC SORT.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 3432 observations read from the data set WORK.POOLED.
NOTE: PROCEDURE BOXPLOT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds

 

However, when I do attempt to sort the data in the following way, it does not work.

proc sort; by group male; 

 

This also does not work.

proc sort; by male group;

 

The odd thing is that this method DOES work on one dataset I have but not another one.

 

Has anyone else experienced this issue?

 

2 REPLIES 2
Reeza
Super User
You never reference data in either of your procs? Can you please post your full code. It should be something like the following:

proc sort DATA=HAVE;
by male group;
run;

proc boxplot data=HAVE;
...

run;
ballardw
Super User

@denserro wrote:

 

However, when I do attempt to sort the data in the following way, it does not work.

proc sort; by group male; 

 

This also does not work.

proc sort; by male group;

 

The odd thing is that this method DOES work on one dataset I have but not another one.

 

Has anyone else experienced this issue?

 


Please describe how or what doesn't work. Do you get an error message from the sort, post the error.

 

When you do not explicitly list the name fo the data set to be used the last created data set is used in procs. You might be attempting to sort a data set other than the one used for the boxplot procedure or plotting a set other than the sorted one.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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