27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

916 MATRIX—END MATRIX<br />

• A symmetric matrix is a square matrix that is unchanged if you flip it about the main diagonal.<br />

That is, the element in row i, column j equals the element in row j, column i. A<br />

symmetric matrix equals its transpose.<br />

• Matrices are always rectangular, although it is possible to read or write symmetric matrices<br />

in triangular form. Vectors and scalars are considered degenerate rectangles.<br />

• It is an error to try to create a matrix whose rows have different numbers of elements.<br />

A matrix program does not process individual cases unless you so specify, using the control<br />

structures of the matrix language. Unlike ordinary SPSS variables, matrix variables do not<br />

have distinct values for different cases. A matrix is a single entity.<br />

Vectors in matrix processing should not be confused with the vectors temporarily created<br />

by the VECTOR command in SPSS. The latter are shorthand for a list of SPSS variables and,<br />

like all ordinary SPSS variables, are unavailable during matrix processing.<br />

Matrix Variables<br />

A matrix variable is created by a matrix statement that assigns a value to a variable name.<br />

• A matrix variable name follows the same rules as those applicable to an ordinary SPSS variable<br />

name.<br />

• The names of matrix functions and procedures cannot be used as variable names within a<br />

matrix program. (In particular, the letter T cannot be used as a variable name because T is<br />

an alias for the TRANSPOS function.)<br />

• The COMPUTE, READ, GET, MGET, and CALL statements create matrices. An index variable<br />

named on a LOOP statement creates a scalar with a value assigned to it.<br />

• A variable name can be redefined within a matrix program without regard to the dimensions<br />

of the matrix it represents. The same name can represent scalars, vectors, and full matrices<br />

at different points in the matrix program.<br />

• MATRIX—END MATRIX does not include any special processing for missing data. When<br />

reading a data matrix from an SPSS data file, you must therefore specify whether missing<br />

data are to be accepted as valid or excluded from the matrix.<br />

String Variables in Matrix Programs<br />

Matrix variables can contain short string data. Support for string variables is limited, however.<br />

• MATRIX will attempt to carry out calculations with string variables if you so request. The<br />

results will not be meaningful.<br />

• You must specify a format (such as A8) when you display a matrix that contains string data.<br />

<strong>Syntax</strong> of Matrix Language<br />

A matrix program consists of statements. Matrix statements must appear in a matrix<br />

program, between the MATRIX and END MATRIX commands. They are analogous to SPSS<br />

commands and follow the rules of the SPSS command language regarding the abbreviation<br />

of keywords; the equivalence of upper and lower case; the use of spaces, commas, and equals

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!