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

SCATTER

Name:
    SCATTER (LET)
Type:
    Let Subcommand
Purpose:
    Save rows of a variable based on index values contained in another variable.
Description:
    The GATHER command (HELP GATHER for details) can be used to extract specific rows of a variable based on an index variable.

    The SCATTER command is most often used after a GATHER command. That is, we use GATHER to extract specific rows of a variable, perform operations that modify these extracted values, and then use SCATTER to save these modfied values back in the original variable.

Syntax:
    LET <y> = SCATTER <x> <index>
    where <x> is a response variable;
                <index> is a variable containing row numbers;
                and <y> is a variable where the values of <x> will be saved.
Examples:
    LET Y = SCATTER X INDEX
Default:
    None
Synonyms:
    None
Related Commands:
    GATHER = Extract specified rows of data from a variable
    SEQUENCE = Generate a patterned sequence of values.
    SORT = Sort a column of numbers.
    RANK = Rank a column of numbers.
    CODE = Code a column of numbers.
    SUBSET = Specifies a subset to be included in a plot, analysis, or LET command.
    RETAIN = Retain specified rows or a subset of a variable.
Applications:
    Data Transformation
Implementation Date:
    2008/11
Program:
     
    let n = 30
    let xseq = sequence 1 1 n
    let x = normal rand numb for i = 1 1 n
    let iindex = data 10  14  8  23  19
    .
    let y = -10 for i = 1 1 n
    let y = scatter x iindex
    set write decimals 3
    print xseq  x  y iindex
        
    The following output is generated.
              1.000         -1.073        -10.000         10.000
              2.000          0.573        -10.000         14.000
              3.000         -0.873        -10.000          8.000
              4.000          0.234        -10.000         23.000
              5.000         -0.455        -10.000         19.000
              6.000         -0.525        -10.000          0.000
              7.000         -0.706        -10.000          0.000
              8.000          0.032         -0.873          0.000
              9.000          1.191        -10.000          0.000
             10.000          0.270         -1.073          0.000
             11.000         -0.149        -10.000          0.000
             12.000         -0.197        -10.000          0.000
             13.000         -0.243        -10.000          0.000
             14.000         -0.841          0.573          0.000
             15.000         -0.104        -10.000          0.000
             16.000          0.419        -10.000          0.000
             17.000          0.264        -10.000          0.000
             18.000          0.898        -10.000          0.000
             19.000          0.034         -0.455          0.000
             20.000          1.588        -10.000          0.000
             21.000          0.389        -10.000          0.000
             22.000         -0.470        -10.000          0.000
             23.000         -1.063          0.234          0.000
             24.000         -0.027        -10.000          0.000
             25.000         -0.464        -10.000          0.000
             26.000          0.592        -10.000          0.000
             27.000         -0.506        -10.000          0.000
             28.000         -0.360        -10.000          0.000
             29.000          0.499        -10.000          0.000
             30.000          0.243        -10.000          0.000
        

Date created: 12/4/2008
Last updated: 12/4/2008
Please email comments on this WWW page to alan.heckert@nist.gov.