Previous Page | Next Page

Functions and CALL Routines

MEDIAN Function



Returns the median value.
Category: Descriptive Statistics

Syntax
Arguments
Details
Comparisons
Examples
See Also

Syntax

MEDIAN(value1<, value2, ...>)


Arguments

value

is a numeric constant, variable, or expression.


Details

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.  [cautionend]


Comparisons

The MEDIAN function returns the median of nonmissing values, whereas the MEAN function returns the arithmetic mean (average).


Examples

SAS Statements Results
x=median(2,4,1,3); 
2.5
y=median(5,8,0,3,4);
4


See Also

Function:

MEAN Function

Previous Page | Next Page | Top of Page