View Full Version : Something weird.


ppmovie
04-07-2009, 02:21 PM
I used the following code to generate mean and median, and the mean function gives me one number only, but the median function gives a list of numbers. Am I supposed to get one number from the median funciton?

Thanks!

proc sql;
select distinct feature, median(value) as median, mean(value) as mean
from dataname
;
quit;

sasMc
04-10-2009, 01:36 PM
Include a group by clause,

see below

proc sql;
select distinct feature,
median(value) as median,
mean(value) as mean
from dataname

group by feature
;

vinux
04-14-2009, 10:06 PM
Group by will not work. Median is a row wise function. it is not a aggragate function

Go through this
http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0608c&L=sas-l&P=55847