Computes median values
Category: Descriptive Statistics
MEDIAN ( value1 <, value2, >)
value
is numeric.
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 |
Function:
'MEAN Function' on page 644