SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Contacts SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Auxiliary Chapter

CROSS TABULATE (LET)

Name:
    CROSS TABULATE (LET)
Type:
    Let Subcommand
Purpose:
    Cross tabulate a variable by 0, 1, or 2 factor variables and place the value of the computed statistic in the new array.
Description:
    This command is related to the CROSS TABULATE analysis command and the CROSS TABULATE PLOT command. Those commands also compute statistics for cross tabulations.

    The distinction is that those commands compute one value of the staistic for unique cell in the cross tabulation. This command creates a new array of the same size as the input arrays and replaces ALL rows in the new array with the computed statistic corresponding to the cell in the cross tabulation.

    The reason for this command is to allow the cross tabulated values to be used in subsequent calculations. For example, you could use this command to subtract the cell mean and divide by the cell standard deviation. Although you can perform this particular computation using the STANDARDIZE command, it does illustrate how this command is intended to be used. In particular, it can helpful in computing statistics for one or two group variables that are not currently supported by the STATISTIC PLOT or CROSS TABULATE PLOT commands.

Syntax 1:
    LET <var> = CROSS TABULATE <stat> <y>             <SUBSET/EXCEPT/FOR qualification>
    where <y> is the response variable;
                <stat> is one of the following statistics;
        MEAN,
        MIDMEAN,
        MEDIAN,
        TRIMMED MEAN,
        WINSORIZED MEAN,
        GEOMETRIC MEAN,
        HARMONIC MEAN,
        HODGES LEHMAN,
        BIWEIGHT LOCATION,
        SUM,
        PRODUCT,
        SIZE (or NUMBER or SIZE),
        STANDARD DEVIATION (or SD),
        STANDARD DEVIATION OF MEAN,
        VARIANCE,
        VARIANCE OF THE MEAN,
        TRIMMED MEAN STANDARD ERROR,
        AVERAGE ABSOLUTE DEVIATION (or AAD),
        MEDIAN ABSOLUTE DEVIATION (or MAD),
        IQ RANGE (or INTERQUARTILE RANGE),
        BIWEIGHT MIDVARIANCE,
        BIWEIGHT SCALE,
        PERCENTAGE BEND MIDVARIANCE,
        WINSORIZED VARIANCE,
        WINSORIZED STANDARD DEVIATION,
        RELATIVE STANDARD DEVIATION,
        RELATIVE VARIANCE,
        COEFFICIENT OF VARIATION,
        RANGE,
        MIDRANGE,
        MAXIMUM,
        MINIMUM,
        EXTREME,
        LOWER HINGE,
        UPPER HINGE,
        LOWER QUARTILE,
        UPPER QUARTILE,
        DECILE,
        PERCENTILE,
        QUANTILE,
        QUANTILE STANDARD ERROR,
        SKEWNESS,
        KURTOSIS,
        NORMAL PPCC,
        AUTOCORRELATION,
        AUTOCOVARIANCE,
        SINE FREQUENCY,
        SINE AMPLITUDE,
        CP,
        CPK,
        CNPK,
        CPM,
        CC,
        EXPECTED LOSS,
        PERCENT DEFECTIVE,
        TAGUCHI SN0 (or SN),
        TAGUCHI SN+ (or SNL),
        TAGUCHI SN- (or SNS),
        TAGUCHI SN00 (or SN2);
                <var> is a variable where the cross tabulated values are stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the no group variable case.

Syntax 2:
    LET <var> = CROSS TABULATE <stat> <y> <x1>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y> is the response variable;
                <stat> is one of the statistics listed under Syntax 1;
                <x1> is a group id variable;
                <var> is a variable where the cross tabulated values are stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the one group variable case.

Syntax 3:
    LET <var> = CROSS TABULATE <stat> <y> <x1> <x2>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y> is the response variable;
                <stat> is one of the statistics listed under Syntax 1;
                <x1> is the first group id variable;
                <x2> is the second group id variable;
                <var> is a variable where the cross tabulated values are stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the two group variable case.

Syntax 4:
    LET <var> = CROSS TABULATE <stat> <y1> <y2>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
                <stat> is one of the following statistics;
        WEIGHTED MEAN,
        WEIGHTED VARIANCE,
        WEIGHTED SD,
        LINEAR INTERCEPT,
        LINEAR SLOPE,
        LINEAR CORRELATION,
        LINEAR RESSD,
        CORRELATION,
        RANK CORRELATION,
        COVARIANCE,
        RANK COVARIANCE,
        WINSORIZED COVARIANCE,
        WINSORIZED COVARIANCE,
        BIWEIGHT MIDCOVARIANCE,
        BIWEIGHT MIDCORRELATION,
        PERCENTAGE BEND CORRELATION,
        DIFFERENCE OF MEAN,
        DIFFERENCE OF MIDMEAN,
        DIFFERENCE OF MEDIAN,
        DIFFERENCE OF TRIMMED MEAN,
        DIFFERENCE OF WINSORIZED MEAN,
        DIFFERENCE OF GEOMETRIC MEAN,
        DIFFERENCE OF HARMONIC MEAN,
        DIFFERENCE OF HODGES LEHMAN,
        DIFFERENCE OF MIDRANGE,
        DIFFERENCE OF BIWEIGHT LOCATION,
        DIFFERENCE OF SUM,
        DIFFERENCE OF STANDARD DEVIATION (or SD),
        DIFFERENCE OF STANDARD DEVIATION OF MEAN,
        DIFFERENCE OF VARIANCE,
        DIFFERENCE OF VARIANCE OF THE MEAN,
        DIFFERENCE OF AVERAGE ABSOLUTE DEVIATION (or AAD),
        DIFFERENCE OF MEDIAN ABSOLUTE DEVIATION (or MAD),
        DIFFERENCE OF IQ RANGE,
        DIFFERENCE OF BIWEIGHT MIDVARIANCE,
        DIFFERENCE OF BIWEIGHT SCALE,
        DIFFERENCE OF PERCENTAGE BEND MIDVARIANCE,
        DIFFERENCE OF WINSORIZED VARIANCE,
        DIFFERENCE OF WINSORIZED SD,
        DIFFERENCE OF RELATIVE STANDARD DEVIATION,
        DIFFERENCE OF RELATIVE VARIANCE,
        DIFFERENCE OF COEFFICIENT OF VARIATION,
        DIFFERENCE OF RANGE,
        DIFFERENCE OF MAXIMUM,
        DIFFERENCE OF MINIMUM,
        DIFFERENCE OF EXTREME,
        DIFFERENCE OF QUANTILE,
        DIFFERENCE OF SKEWNESS,
        DIFFERENCE OF KURTOSIS;
                <var> is a variable where the cross tabulated values are stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the no group variable case.

Syntax 5:
    LET <var> = CROSS TABULATE <stat> <y1> <y2> <x1>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
                <stat> is one of the statistics listed under Syntax 4;
                <x1> is a group id variable;
                <var> is a variable where the cross tabulated values are stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the one group variable case.

Syntax 6:
    LET <var> = CROSS TABULATE <stat> <y1> <y2> <x1> <x2>
                            <SUBSET/EXCEPT/FOR qualification>
    where <y1> is the first response variable;
                <y2> is the second response variable;
                <stat> is one of the statistics listed under Syntax 4;
                <x1> is the first group id variable;
                <x2> is the second group id variable;
                <var> is a variable where the cross tabulated values are stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax is used for the two group variable case.

Examples:
    LET Y2 = CROSS TABULATE Y
    LET Y2 = CROSS TABULATE Y X1
    LET Y2 = CROSS TABULATE Y X1 X2
    LET Y2 = CROSS TABULATE Y X1 X2 SUBSET X1 = 1 TO 3
Note:
    To specify the lower and upper proportions for the trimmed mean and Winsorized mean statistics, enter the following commands:

      LET P1 = <value>
      LET P2 = <value>
Default:
    None
Synonyms:
    None
Related Commands:
    MEAN PLOT = Generate a mean versus subset plot.
    SD PLOT = Generate a standard deviation versus subset plot.
    TABULATE = Compute group statistics (one group variable).
    CROSS TABULATE = Compute group statistics (two group variables).
    CROSS TABULATE PLOT = Generate a statistive versus (two) subset variables.
Applications:
    Data Analysis
Implementation Date:
    2001/10
Program:
    SKIP 25
    READ GEAR.DAT Y X
    LET YMED = CROSS TABULATE MEAN Y X
    LET YIQ = CROSS TABULATE IQ RANGE Y X
    LET YSTAND = (Y - YMED)/YIQ

Date created: 10/5/2001
Last updated: 4/4/2003
Please email comments on this WWW page to alan.heckert@nist.gov.