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 CROSS TABULATE

Name:
    CODE CROSS TABULATE
Type:
    Let Subcommand
Purpose:
    Generate a coded group id variable.
Description:
    A number of Dataplot commands expect data in the form

      Y    X

    with Y denoting a response variable and X denoting a group id variable.

    There may be times when you want to use one of these commands when there are multiple group id variables. For example, you may want to generate box plots, mean plots, or strip plots for the values withn each combination of group id's. It can also be used to simplify multiple SUBSET clauses.

    The CODE CROSS TABULATE command can be used to generate a single group id variable from multiple group id variables. From two to six group id variables may be used.

    For example, if X1 defines 3 groups and X2 defines 4 groups, then the generated variable, XCODE, will be defined as

      X1 X2 XCODE
      1 1 1
      1 2 2
      1 3 3
      1 4 4
      2 1 5
      2 2 6
      2 3 7
      2 4 8
      3 1 9
      3 2 10
      3 3 11
      3 4 12
Syntax:
    LET <xcode> = CODE CROSS TABULATE <x1> ... <xk>
                            <SUBSET/EXCEPT/FOR qualification>
    where <x1> is the first group id variable;
                <xk> is the kth group id variable;
                <xcode> is a variable where the coded values are saved;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    The minimum number of group id variables is two and the maximum number of group id variables is six.

    The variables on the right hand side of the equal sign must all have the same number of elements, The <xcode> variable will also have this number of elements.

Examples:
    LET XCODE = CODE CROSS TABULATE X1 X2
    LET XCODE = CODE CROSS TABULATE X1 X2 X3
    LET XCODE = CODE CROSS TABULATE X1 X2 X3 X4
    LET XCODE = CODE CROSS TABULATE X1 X2 X3 X4 X5
    LET XCODE = CODE CROSS TABULATE X1 X2 X3 X4 X5 X6
Note:
    For plot commands, you may want to control the values of the coded variable. There are two ways you can do this:

    1. You can define an initial offset with the command

        SET CROSS TABULATE OFFSET <value>

      For example, if <value> = 3, then the first value for the coded value will be 4 (1 + 3 = 4).

    2. You can define the spacing between groups with the commands

        SET CROSS TABULATE GROUP SIZE ONE <value>
        SET CROSS TABULATE GROUP SIZE TWO <value>
        SET CROSS TABULATE GROUP SIZE THREE <value>
        SET CROSS TABULATE GROUP SIZE FOUR <value>
        SET CROSS TABULATE GROUP SIZE FIVE <value>

    If OFFSET defines the offset, NGROUP1, ..., NGROUP define the number of distinct elements in the group variables, and ICCTG1, ... ICCTG5 define the values defined by the SET CROSS TABULATE GROUP SIZE commands, then the coded variable will be defined as

      For 2 group id variables:
      ICODE = OFFSET + (ISET1-1)NFACT2 + ISET2

      For 3 group id variables:
      ICODE = OFFSET + (ISET1-1)*NFACT2*NFACT3 + (ISET2-1)*NFACT3 + ISET3

      For 4 group id variables:
      ICODE = OFFSET + (ISET1-1)*NFACT2*NFACT3*NFACT4 + (ISET2-1)*NFACT3*NFACT4 + (ISET3-1)*NFACT + ISET4

      For 5 group id variables:
      ICODE = OFFSET + (ISET1-1)*NFACT2*NFACT3*NFACT4*NFACT5 + (ISET2-1)*NFACT3*NFACT4*NFACT5 + (ISET3-1)*NFACT4*NFACT5 (ISET4-1)*NFACT5 + ISET5

      For 6 group id variables:
      ICODE = OFFSET + (ISET1-1)*NFACT2*NFACT3*NFACT4*NFACT5*NFACT6 + (ISET2-1)*NFACT3*NFACT4*NFACT5*NFACT6 + (ISET3-1)*NFACT4*NFACT5*NFACT6 + (ISET4-1)*NFACT5*NFACT6 + (ISET5-1)*NFACT6 + ISET6

    where ISET1, ..., ISET6 define the i-th distinct value of groups one to six, respectively, and

      NFACT2 = MAX(NGROUP2,ICCTG1)
      NFACT3 = MAX(NGROUP3,ICCTG2)
      NFACT4 = MAX(NGROUP4,ICCTG3)
      NFACT5 = MAX(NGROUP5,ICCTG4)
      NFACT6 = MAX(NGROUP6,ICCTG5)
Default:
    None
Synonyms:
    None
Related Commands:
    CODE = Generate a coded variable.
    COCODE = Generate a cocoded variable.
    CODE2 = Generate a binary coded variable.
    CODE4 = Generate a quartile coded variable.
    CODE8 = Generate an octal coded variable.
    CODEH = Generate a hinge coded variable.
Applications:
    Data Manipulation
Implementation Date:
    2009/6
Program:
    SKIP 25
    READ FURNACE.DAT RUN ZONE WAFER FILMTHIC
    .
    SET CODE CROSS TABULATE OFFSET 8
    SET CODE CROSS TABULATE GROUP SIZE ONE 10
    LET IX = CODE CROSS TABULATE WAFER ZONE
    .
    FENCES ON
    CHARACTER BOX PLOT
    LINE BOX PLOT
    YLIMITS 450 650
    XLIMITS 10 20
    TIC OFFSET UNITS DATA
    XTIC MARK OFFSET 5 5
    .
    LABEL CASE ASIS
    TIC MARK LABEL CASE ASIS
    MAJOR XTIC MARK NUMBER 2
    MAJOR XTIC MARK NUMBER 0
    X1TIC MARK LABEL FORMAT ALPHA
    X1TIC MARK LABEL CONTENT ...
          Zonesp()-sp()1SP()2SP()3SP()4CR()Wafersp()1 ...
          Zonesp()-sp()1SP()2SP()3SP()4CR()Wafersp()2
    Y1LABEL Film Thickness
    .
    BOX PLOT FILMTHIC IX
        
    plot generated by sample program

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