Previous Page | Next Page

Functions and CALL Routines

ORDINAL Function



Returns the kth smallest of the missing and nonmissing values.
Category: Descriptive Statistics

Syntax
Arguments
Details
Comparisons
Examples

Syntax

ORDINAL(k,argument-1,argument-2<,...argument-n>)


Arguments

k

is a numeric constant, variable, or expression with an integer value that is less than or equal to the number of subsequent elements in the list of arguments.

argument

specifies a numeric constant, variable, or expression. At least two arguments are required. An argument can consist of a variable list, preceded by OF.


Details

The ORDINAL function returns the kth smallest value, either missing or nonmissing, among the second through the last arguments.


Comparisons

The ORDINAL function counts both missing and nonmissing values, whereas the SMALLEST function counts only nonmissing values.


Examples

SAS Statements Results
x1=ordinal(4,1,2,3,-4,5,6,7);
3

Previous Page | Next Page | Top of Page