Dataplot Vol 2 Vol 1

# MATRIX GROUP MEANS

Name:
MATRIX GROUP MEANS (LET)
Type:
Let Subcommand
Purpose:
Compute the group means of a matrix.
Description:
This command operates on a matrix (M) and a group id variable (TAG). The TAG variable has the same number of rows as the matrix M. The values of TAG are typically integers that identify the group to which the corresponding row of the matrix belongs.

The MATRIX GROUP MEANS command returns a matrix with the same number of columns as the original matrix M and with the number or rows equal the number of groups identified by the TAG variable. That is, MEANS(2,3) is the mean of of the third variable of the second group.

Syntax:
LET <mat2> = MATRIX GROUP MEANS <mat1> <tag>
<SUBSET/EXCEPT/FOR qualification>
where <mat1> is a matrix for which the group means are to be computed;
<tag> is the group-id variable;
<mat2> is a matrix where the resulting group means are saved;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET MMEAN = MATRIX GROUP MEANS M TAG
LET MMEAN = MATRIX GROUP MEANS M TAG SUBSET TAG = 1 TO 2
Note:
Matrices are created with either the READ MATRIX command or the MATRIX DEFINITION command. Enter HELP MATRIX DEFINITION and HELP READ MATRIX for details.
Note:
Row and column statistics for a matrix can be computed using the MATRIX ROW STATISTIC and MATRIX COLUMN STATISTIC commands. Enter HELP MATRIX ROW STATISTIC and HELP MATRIX COLUMN STATISTIC for details.
Default:
None
Synonyms:
MATRIX GROUP MEAN is a synonym for MATRIX GROUP MEANS.
Related Commands:
 MATRIX GROUP SD = Compute the group standard deviations for a matrix. MATRIX MEAN = Compute the overall mean for a matrix. MATRIX COLUMN STATISTIC = Compute column statistics for a matrix. MATRIX ROW STATISTIC = Compute row statistics for a matrix. MATRIX COLUMN DIMENSION = Dimension maximum number of columns for Dataplot matrices.
Reference:
"Applied Multivariate Statistical Analysis", Third Edition, Johnson and Wichern, Prentice-Hall, 1992.
Applications:
Multivariate Analysis
Implementation Date:
1998/8
Program:
DIMENSION 50 COLUMNS
SKIP 25
READ IRIS.DAT Y1 Y2 Y3 Y4 TAG
LET N = SIZE Y1
LET M = MATRIX DEFINITION Y1 N 4
LET Z = MATRIX GROUP MEANS M TAG

Date created: 6/5/2001
Last updated: 4/4/2003