SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

LARGEST

Name:
    LARGEST (LET)
Type:
    Let Subcommand
Purpose:
    Extract the largest elements of a variable.
Description:
    This is a generalization of the MAXIMUM command. However, instead of returning the single largest value, it returns the user specified number of largest values.

    The values will be returned in sorted order. If the requested number of largest values is less than 1, then an error will be returned. If the requested number of largest values is greater than the number of observations in the response variable, then the full response variable will be returned in sorted order.

Syntax:
    LET <y> = LARGEST <x> <nval>                         <SUBSET/EXCEPT/FOR>
    where <x> is a response variable;
                <nval> is a number or parameter that specifies how many values to extract;
                <y> is a variable that contains the largest values;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET NVAL = 3
    LET Y = LARGEST X NVAL

    LET Y = LARGEST X 3 LET Y = LARGEST X 5 LET Y = LARGEST X 5 FOR I = 1 1 500

Default:
    None
Synonyms:
    None
Related Commands:
    SMALLEST = Return the smalles values in a variable.
    MAXIMUM = Return the maximum value of a variable.
    MINIMUM = Return the minimum value of a variable.
Applications:
    Data Transformation
Implementation Date:
    2018/10
Program:
     
    let y = normal random numbers for i = 1 1 100
    let nval = 5
    let yout = largest y nval
    set write decimals 3
    print yout
        
    The following output is returned
    ---------------
               YOUT
    ---------------
              1.685
              2.052
              2.068
              2.480
              2.678
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 10/10/2018
Last updated: 10/10/2018

Please email comments on this WWW page to alan.heckert@nist.gov.