LARGEST Function


Returns the k th largest non-missing value

Category: Descriptive Statistics

Syntax

LARGEST ( k , value-1 <, value-2 ...>)

Arguments

k

  • is a numeric constant, variable, or expression that specifies which value to return.

value

  • specifies the value of a numeric constant, variable, or expression to be processed .

Details

If k is missing, less than zero, or greater than the number of values, the result is a missing value and _ERROR_ is set to 1. Otherwise, if k is greater than the number of non-missing values, the result is a missing value but _ERROR_ is not set to 1.

Examples

The following SAS statements produce these results.

SAS Statements

Results

  k=1;   largest1=largest(k, 456, 789, .Q, 123);   put largest1;  
  789  
  k=2;   largest2=largest(k, 456, 789, .Q, 123);   put largest2;  
  456  
  k=3;   largest3=largest(k, 456, 789, .Q, 123);   put largest3;  
  123  
  k=4;   largest4=largest(k, 456, 789, .Q, 123);   put largest4;  
  .  

See Also

Functions:

  • 'ORDINAL Function' on page 692

  • 'PCTL Function' on page 694

  • 'SMALLEST Function' on page 824




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net