 Dataplot Vol 1 Auxillary Chapter

# TABULATE

Name:
TABULATE
Type:
Analysis Command
Purpose:
Generates a tabulation of a statistic for a response variable with one group variables.
Description:
For grouped data, we often want to compute a given statistic (e.g., the mean or the standard deviation) for each distinct group. This command provides a convenient way to do this.
Syntax 1:
TABULATE <y1> <tag>             <SUBSET/EXCEPT/FOR qualification>
TABULATE <tag>                       <SUBSET/EXCEPT/FOR qualification>
TABULATE COUNTS <y1> <tag>       <SUBSET/EXCEPT/FOR qualification>
TABULATE COUNTS <tag>                 <SUBSET/EXCEPT/FOR qualification>
where <y1> is a response variable;
<tag1> is a group identifier variable;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax generates a count of the number of elements in each group. Specifying the response variable (<y1> is optional (and usually omitted) since it is not used in the calculation for the counts.

Syntax 2:
TABULATE <STAT> <y1> <tag>             <SUBSET/EXCEPT/FOR qualification>
where <y1> is a response variable;
<tag> is a group identifier variable;
<stat> is one of the following statistics:
MEAN, MIDMEAN, MEDIAN, TRIMMED MEAN, WINSORIZED MEAN,
GEOMETRIC MEAN, HARMONIC MEAN, HODGES LEHMAN,
BIWEIGHT LOCATION,LP LOCATION,
SUM, PRODUCT, SIZE (or NUMBER or SIZE),
STANDARD DEVIATION, STANDARD DEVIATION OF MEAN,
VARIANCE, VARIANCE OF THE MEAN,
VARIANCE OF LP LOCATION,
SD OF LP LOCATION,
TRIMMED MEAN STANDARD ERROR,
IQ RANGE, BIWEIGHT MIDVARIANCE, BIWEIGHT SCALE,
PERCENTAGE BEND MIDVARIANCE, SN SCALE, QN SCALE,
WINSORIZED VARIANCE, WINSORIZED STANDARD DEVIATION,
RELATIVE STANDARD DEVIATION, RELATIVE VARIANCE (or
COEFFICIENT OF VARIATION),
RANGE, MIDRANGE, MAXIMUM, MINIMUM, EXTREME,
LOWER HINGE, UPPER HINGE,
LOWER QUARTILE, UPPER QUARTILE,
<FIRST/SECOND/THIRD/FOURTH/FIFTH/SIXTH/SEVENTH/EIGHTH/
NINTH/TENTH> DECILE,
PERCENTILE, QUANTILE, QUANTILE STANDARD ERROR,
SKEWNESS, KURTOSIS, NORMAL PPCC,
AUTOCORRELATION, AUTOCOVARIANCE,
CP, CPK, CNPK, CPM, CC,
EXPECTED LOSS, PERCENT DEFECTIVE,
SINE FREQUENCY, SINE AMPLITUDE,
TAGUCHI SN0 (or SN), TAGUCHI SN+ (or SNL),
TAGUCHI SN- (or SNS), TAGUCHI SN00 (or SN2);

and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax computes the value of the specified statistic of the elements in the response variable () for each Cdistinct group.

Syntax 3:
TABULATE <STAT> <y1> <y2> <tag>
<SUBSET/EXCEPT/FOR qualification>
where <y1> is the first response variable;
<y2> is the second response variable;
<tag> is a group identifier variable;
<stat> is one of the following statistics:
LINEAR INTERCEPT, LINEAR SLOPE, LINEAR RESSD,
LINEAR CORRELATION,
CORRELATION, RANK CORRELATION,
COVARIANCE, RANK COVARIANCE,
COMOVEMENT, RANK COMOVEMENT,
WINSORIZED COVARIANCE, WINSORIZED COVARIANCE,
BIWEIGHT MIDCOVARIANCE, BIWEIGHT MIDCORRELATION,
PERCENTAGE BEND CORRELATION,
RATIO;

and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax computes the value of the specified statistic of the elements in the response variables ( and ) for each distinct group.

Syntax 4:
TABULATE WEIGHTED <STAT> <y1> <wt> <tag>
<SUBSET/EXCEPT/FOR qualification>
where <y1> is the response variable;
<wt> is the weights variable;
<tag> is a group identifier variable;
<stat> is one of the following statistics:
MEAN, STANDARD DEVIATION (or SD), VARIANCE;

and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax computes the value of the specified weighted statistic of the elements in the response variable () for each distinct group.

Syntax 5: TABULATE DIFFERENCE OF <STAT> <y1> <y2> <tag>
<SUBSET/EXCEPT/FOR qualification>
where <y1> is the first response variable;
<y2> is the second response variable;
<tag> is a group identifier variable;
<stat> is one of the following statistics:
MEAN, MIDMEAN, MEDIAN, TRIMMED MEAN, WINSORIZED MEAN,
GEOMETRIC MEAN, HARMONIC MEAN, HODGES LEHMAN,
MIDRANGE, BIWEIGHT LOCATION, LP LOCATION,SUM,
STANDARD DEVIATION, STANDARD DEVIATION OF MEAN,
VARIANCE, VARIANCE OF THE MEAN,
VARIANCE OF LP LOCATION,
SD OF LP LOCATION,
IQ RANGE, BIWEIGHT MIDVARIANCE, BIWEIGHT SCALE,
PERCENTAGE BEND MIDVARIANCE, SN SCALE, QN SCALE,
WINSORIZED VARIANCE, WINSORIZED STANDARD DEVIATION,
RELATIVE STANDARD DEVIATION, RELATIVE VARIANCE,
COEFFICIENT OF VARIATION, RANGE,
MAXIMUM, MINIMUM, EXTREME, QUANTILE,
SKEWNESS, KURTOSIS;

and where the <SUBSET/EXCEPT/FOR qualification> is optional.

This syntax computes the difference between two response variables of the specified statistic for each distinct group. Examples:

TABULATE MEAN Y1 TAG
TABULATE MEDIAN Y1 TAG
TABULATE SD Y1 TAG
TABULATE SD Y1 TAG SUBSET TAG > 2
Note:
The TABULATE command generates the computed statistics in tabular form. The STATISTIC PLOT command can be used to generate the computed statistics in graphical form. Enter HELP STATISTIC PLOT for details.
Note:
The table of computed statistics is also written to file "dpst1f.dat" in the current directory. This is useful for using the computed values in subsequent analysis.

To create and read these values, enter the following command sequence:

TABULATE MEAN Y X
SKIP 1
Default:
None
Synonyms:
None
Related Commands:
 CROSS TABULATE = Computes a given statistic for the case with two group identifier variables. STATISTIC PLOT = Graph the value of a statistic for grouped data.
Applications:
Exploratory Data Analysis
Implementation Date:
Pre-1987: Implemented for the MEAN, SD, RANGE, and COUNTS
2002/8: List of supported statistics greatly expanded.
2003/3: Support for "WEIGHTED" and "DIFFERENCE OF" statistics added.

As statistics are added to the LET command, they are also added to the TABULATE command. We do not document the implementation date here (the implementation date will be documented in the HELP for that statistic).

Program:
```
SKIP 25
TABULATE BATCH
TABULATE MEANS DIAMETER BATCH
TABULATE MEDIAN DIAMETER BATCH
TABULATE SD DIAMETER BATCH
TABULATE RANGE DIAMETER BATCH
```
The following output is generated.
```

**********************
**  TABULATE BATCH  **
**********************

BATCH       *    COUNTS
**********************************************
1.00000     *     10.0000
2.00000     *     10.0000
3.00000     *     10.0000
4.00000     *     10.0000
5.00000     *     10.0000
6.00000     *     10.0000
7.00000     *     10.0000
8.00000     *     10.0000
9.00000     *     10.0000
10.0000     *     10.0000

GROUP-ID AND STATISTIC WRITTEN TO FILE DPST1F.DAT

************************************
**  TABULATE MEAN DIAMETER BATCH  **
************************************

*    DIAMETER
BATCH       *    MEAN
**********************************************
1.00000     *    0.998000
2.00000     *    0.999100
3.00000     *    0.995400
4.00000     *    0.998200
5.00000     *    0.991900
6.00000     *    0.998800
7.00000     *     1.00150
8.00000     *     1.00040
9.00000     *    0.998300
10.0000     *    0.994800

GROUP-ID AND STATISTIC WRITTEN TO FILE DPST1F.DAT

**************************************
**  TABULATE MEDIAN DIAMETER BATCH  **
**************************************

*    DIAMETER
BATCH       *    MEDIAN
**********************************************
1.00000     *    0.998500
2.00000     *    0.999000
3.00000     *    0.996000
4.00000     *    0.997000
5.00000     *    0.994500
6.00000     *    0.997500
7.00000     *     1.00050
8.00000     *     1.00000
9.00000     *    0.998000
10.0000     *    0.996000

GROUP-ID AND STATISTIC WRITTEN TO FILE DPST1F.DAT

**********************************
**  TABULATE SD DIAMETER BATCH  **
**********************************

*    DIAMETER
BATCH       *    STANDARD DEVIATION
**********************************************
1.00000     *    0.434614E-02
2.00000     *    0.521644E-02
3.00000     *    0.397772E-02
4.00000     *    0.385284E-02
5.00000     *    0.757850E-02
6.00000     *    0.988602E-02
7.00000     *    0.787753E-02
8.00000     *    0.362707E-02
9.00000     *    0.413788E-02
10.0000     *    0.532917E-02

GROUP-ID AND STATISTIC WRITTEN TO FILE DPST1F.DAT

*************************************
**  TABULATE RANGE DIAMETER BATCH  **
*************************************

*    DIAMETER
BATCH       *    RANGE
**********************************************
1.00000     *    0.140001E-01
2.00000     *    0.180001E-01
3.00000     *    0.130000E-01
4.00000     *    0.110000E-01
5.00000     *    0.220000E-01
6.00000     *    0.320001E-01
7.00000     *    0.280000E-01
8.00000     *    0.100001E-01
9.00000     *    0.130000E-01
10.0000     *    0.200000E-01

GROUP-ID AND STATISTIC WRITTEN TO FILE DPST1F.DAT

```

Date created: 12/5/2005
Last updated: 12/5/2005