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

MATRIX SCALE

Name:
    MATRIX SCALE (LET)
Type:
    Let Subcommand
Purpose:
    Scale a matrix.
Description:
    For some computations, such as computing a distance matrix, it may be desirable to scale the matrix first. The scaling may be performed over either rows or columns.

    Dataplot supports the following types of scaling.

    1. MEAN - subtract the column mean from each column of the matrix (or subtract the row mean from each row).

    2. SD - divide each column by the column standard deviation (or divide each row by the row standard deviation).

    3. ZSCORE - subtract the column mean and then divide by the column standard deviation for each column (or subtract the row mean and divide by the row standard deviation for each row).

    4. RANGE - divide each column by the column range (or divide each row by the row range).

    The type of scaling is specified by entering the command

      SET MATRIX SCALE <NONE/MEAN/SD/ZSCORE/RANGE>

    Specifying NONE applies no scaling.

Syntax 1:
    LET <mat2> = MATRIX ROW SCALE <mat1>
    where <mat1> is a matrix for which the matrix scaling is to be computed;
    and where <mat2> is a matrix where the resulting scaled matrix is saved.

    This syntax scales relative to rows. The scaled matrix can be the same as the original data matrix.

Syntax 2:
    LET <mat2> = MATRIX COLUMN SCALE <mat1>
    where <mat1> is a matrix for which the matrix scaling is to be computed;
    and where <mat2> is a matrix where the resulting scaled matrix is saved.

    This syntax scales relative to columns. The scaled matrix can be the same as the original data matrix.

Examples:
    SET MATRIX SCALE MEAN
    LET M = MATRIX ROW SCALE M

    SET MATRIX SCALE SD
    LET M = MATRIX COLUMN SCALE M

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.
Default:
    None
Synonyms:
    None
Related Commands:
    READ MATRIX = Read a matrix.
    MATRIX COLUMN DIMENSION = Dimension maximum number of columns for Dataplot matrices.
    MATRIX DISTANCE = Compute a distance matrix.
Reference:
    "Applied Multivariate Statistical Analysis", Third Edition, Johnson and Wichern, Prentice-Hall, 1992.
Applications:
    Multivariate Analysis
Implementation Date:
    1998/8
Program:
    DIMENSION 200 COLUMNS
    SKIP 25
    READ IRIS.DAT SEPLENG SEPWIDTH PETLENG PETWIDTH TAG
    SKIP 0
    LET NTOT = SIZE SEPLENG
    LET X = MATRIX DEFINITION SEPLENG NTOT 4
    SET MATRIX SCALE ZSCORE
    LET X = MATRIX COLUMN SCALING X

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