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.

MATRIX—END MATRIX 927<br />

• The first statement computes a scalar. Note that the braces are optional on a scalar constant.<br />

• The second statement computes the square of the matrix R. R can be any square matrix,<br />

including a scalar.<br />

• The third statement computes a vector named FLAGS, which has the same dimension as the<br />

existing vector EIGENVAL. Each element of FLAGS equals 1 if the corresponding element of<br />

EIGENVAL is greater than or equal to 1, and 0 if the corresponding element is less than 1.<br />

• The fourth statement constructs a matrix ESTIM by concatenating the three vectors or<br />

matrices OBS, PRED, and ERR. The component matrices must have the same number of<br />

rows.<br />

Matrix Functions<br />

The following functions are available in the matrix program. Except where noted, each takes<br />

one or more numeric matrices as arguments and returns a matrix value as its result. The arguments<br />

must be enclosed in parentheses, and multiple arguments must be separated by commas.<br />

On the following list, matrix arguments are represented by names beginning with M.<br />

Unless otherwise noted, these arguments can be vectors or scalars. Arguments that must be<br />

vectors are represented by names beginning with V, and arguments that must be scalars are<br />

represented by names beginning with S.<br />

ABS(M) Absolute value. Takes a single argument. Returns a matrix having the<br />

same dimensions as the argument, containing the absolute values of its<br />

elements.<br />

ALL(M) Test for all elements nonzero. Takes a single argument. Returns a<br />

scalar: 1 if all elements of the argument are nonzero and 0 if any<br />

element is zero.<br />

ANY(M) Test for any element nonzero. Takes a single argument. Returns a<br />

scalar: 1 if any element of the argument is nonzero and 0 if all elements<br />

are zero.<br />

ARSIN(M) Inverse sine. Takes a single argument, whose elements must be<br />

between – 1 and 1. Returns a matrix having the same dimensions as<br />

the argument, containing the inverse sines (arcsines) of its elements.<br />

The results are in radians and are in the range from – π ⁄ 2 to π ⁄ 2 .<br />

ARTAN(M) Inverse tangent. Takes a single argument. Returns a matrix having the<br />

same dimensions as the argument, containing the inverse tangents (arctangents)<br />

of its elements, in radians. To convert radians to degrees, multiply<br />

by 180 ⁄ π , which you can compute as 45 ⁄<br />

ARTAN( 1)<br />

. For example, the<br />

statement COMPUTE DEGREES=ARTAN(M)*45/ARTAN(1) returns a<br />

matrix containing inverse tangents in degrees.<br />

BLOCK(M1,M2,...) Create a block diagonal matrix. Takes any number of arguments.<br />

Returns a matrix with as many rows as the sum of the rows in all the<br />

arguments, and as many columns as the sum of the columns in all the<br />

arguments, with the argument matrices down the diagonal and zeros<br />

elsewhere. For example, if:

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

Saved successfully!

Ooh no, something went wrong!