BookmarkSubscribeRSS Feed
Rogerio_Alves
Obsidian | Level 7

Hi everybody,

 

 

I'm using the PROC MEANS in order to get the MIN, MAX, RANGE and MEAN of a group of values. The MIN, MAX and MEAN returns well but for RANGE was returned the SUM of MIN and MAX values.

 

This is my code:

 

proc means data=TBL min max mean range maxdec=0 ;
class ano local categoria;
var valor;
run;

 

The result I've got:

 

image.png

 

 

The SAS Guide information:

 

image.png

 

Tks to help!

Rogerio Alves
5 REPLIES 5
ed_sas_member
Meteorite | Level 14

Hi @Rogerio_Alves 

The range is actually the difference between max and min so 64831 - (-20413) = 85244

 

Best,

Rogerio_Alves
Obsidian | Level 7

Hi, I got you! You'r right, I was with a wrong concept about RANGE could be.

 

Thanks a lot to explain.

 

Appreciate.

Rogerio Alves
ed_sas_member
Meteorite | Level 14
You're welcome @Rogerio_Alves !
Could you please mark the topic as answered?
Thanks
ballardw
Super User

Given what you have shown us, what did you expect the range to be?

 

Also note that the sum of 64831 and -20413 is 44418.

Rogerio_Alves
Obsidian | Level 7

I got you! Thanks a lot!

Rogerio Alves

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1710 views
  • 2 likes
  • 3 in conversation