MATRIX GROUP MEANS
Compute the group means of a matrix.
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
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.
LET <mat2> = MATRIX GROUP MEANS <mat1> <tag>
where <mat1> is a matrix for which the group means are to
<tag> is the group-id variable;
<mat2> is a matrix where the resulting group means
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET MMEAN = MATRIX GROUP MEANS M TAG
LET MMEAN = MATRIX GROUP MEANS M TAG SUBSET TAG = 1 TO 2
Matrices are created with either the READ MATRIX command or
the MATRIX DEFINITION command. Enter HELP MATRIX DEFINITION
and HELP READ MATRIX for details.
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.
MATRIX GROUP MEAN is a synonym for MATRIX GROUP MEANS.
MATRIX GROUP SD
= Compute the group standard deviations for a matrix.
= 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
"Applied Multivariate Statistical Analysis", Third Edition,
Johnson and Wichern, Prentice-Hall, 1992.
DIMENSION 50 COLUMNS
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
Please email comments on this WWW page to