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

Name:
    CODE DEX (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 command to convert them to classical units.

    This command should only be used if your data has 2 or 3 distinct values. If you have more than 3 distinct values, and error message will be generated and the coded variable will not be created. If you have only one unique value, the code variable will set all values to +1.

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

      LET X2 = CODE DEX 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 command. For example

      LOOP FOR J = 1 1 K
                  LET Z^J = X^J
                  LET X^J = CODE DEX Z^J
      END OF LOOP
Default:
    None
Synonyms:
    DEX CODE
Related Commands:
    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/02
Program:
     
    SKIP 50
    READ CLAYTILE.DAT Y X1 TO X7
    LOOP FOR J = 1 1 7
        LET X^J = CODE DEX X^J
    END OF LOOP
    .
    SET WRITE DECIMALS 0
    PRINT Y X1 X2 X3 X4 X5 X6 X7
        
    The following output is generated.
    ------------------------------------------------------------
                  Y             X1             X2             X3
    ------------------------------------------------------------
                 16             -1             -1             -1
                 17             -1             -1             -1
                 12             -1              1              1
                  6             -1              1              1
                  6              1             -1              1
                 68              1             -1              1
                 42              1              1             -1
                 26              1              1             -1
     
     
    ------------------------------------------------------------
                 X4             X5             X6             X7
    ------------------------------------------------------------
                 -1             -1             -1             -1
                  1              1              1              1
                 -1             -1              1              1
                  1              1             -1             -1
                 -1              1             -1              1
                  1             -1              1             -1
                 -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: 04/04/2018
Last updated: 04/04/2018

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