Functions and CALL Routines |
Returns the median value.
Category: |
Descriptive Statistics
|
MEDIAN(value1<, value2,
...>)
|
-
value
-
is a numeric constant, variable, or expression.
The MEDIAN function returns the median
of the nonmissing values. If all arguments have missing values, the result
is a missing value.
Note: The formula that is used in the MEDIAN function
is the same as the formula that is used in PROC UNIVARIATE. For more information,
see SAS Elementary Statistics Procedures in
Base SAS Procedures Guide.
The MEDIAN function returns the median
of nonmissing values, whereas the MEAN function returns the arithmetic mean
(average).
SAS Statements |
Results |
x=median(2,4,1,3);
|
2.5
|
y=median(5,8,0,3,4);
|
4
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.