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

CODE DEX 2-LEVEL

Name:
    CODE DEX 2-LEVEL (LET)
Type:
    Let Subcommand
Purpose:
    Generate a coded variable for a factor variable used in analyzing a 2-level full or fractional factorial design.
Description:
    To analyze a 2-level full or fractional factorial design, the factor variable are typically coded with lower level set to -1, the upper level set to +1, and center points set to 0. This will be referred to as classical units.

    If your factor variables are in original units of the data rather than classical units, you can use the CODE DEX 2-LEVEL command to convert them to classical units.

    In some cases, you may only want the minimum and maximum values (i.e., the "-1" and "+1" points). For example, for the dex interaction effects plot in the ten step analysis we need exactly two levels.

    This command is similar to the CODE DEX command. The distinction is that CODE DEX preserves the center points and expects a maximum of the 3 distinct values. The CODE DEX 2-LEVEL command will accept any number of levels, but only saves the minimum and maximum levels.

Syntax:
    LET <y> = CODE DEX 2-LEVEL <x>
                            <SUBSET/EXCEPT/FOR qualification>
    where <x> is the factor variable;
                <y> is a variable where the coded values are saved;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET X2OUT = CODE DEX 2-LEVEL X2
Note:
    You can use the same name for the input variable and the output variable. For example

      LET X2 = CODE DEX 2-LEVEL X2

    If you want to have variables in the original units for some purposes, you can save the data in original units before using the CODE DEX 2-LEVEL command. For example

      LOOP FOR J = 1 1 K
        LET Z^J = X^J
        LET X^J = CODE DEX 2-LEVEL Z^J
      END OF LOOP
Default:
    None
Synonyms:
    DEX CODE 2-LEVEL
    CODE DEX 2LEVEL
    DEX CODE 2LEVEL
Related Commands:
    CODE DEX = Convert to classic units but preserve center points.
    DEX CHECK CLASSIC = Determine if your factor variables are in classic units.
    CODE = Generate a coded variable based on distinct values.
Applications:
    Analysis of 2-level full and fractional factorial designs
Implementation Date:
    2018/10
Program:
     
    read x1
    24
    36
    24
    36
    24
    36
    24
    36
    30
    30
    end of data
    .
    set write decimals 0
    let y1 = code dex x1
    let y2 = code dex 2-level x1
    print x1 y1
    print y2
        
    The following output is returned
     
    ------------------------------
                 X1             Y1
    ------------------------------
                 24             -1
                 36              1
                 24             -1
                 36              1
                 24             -1
                 36              1
                 24             -1
                 36              1
                 30              0
                 30              0
     
     
    ---------------
                 Y2
    ---------------
                 -1
                  1
                 -1
                  1
                 -1
                  1
                 -1
                  1
        

Privacy Policy/Security Notice
Disclaimer | FOIA

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

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

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