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-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!

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
  • 1067 views
  • 2 likes
  • 3 in conversation