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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MATRIX—END MATRIX 949<br />

• A matrix named SCORES is read from the working data file.<br />

• The variables TEST1, TEST2, and TEST3 form the columns of the matrix, while the cases in<br />

the working file form the rows.<br />

• A vector named VARNAMES, whose three elements contain the variable names TEST1,<br />

TEST2, and TEST3, is created.<br />

• User-missing values defined in the working data file are accepted into the matrix SCORES.<br />

• System-missing values in the working data file are converted to the value –<br />

1 in the matrix<br />

SCORES.<br />

SAVE Statement: Writing SPSS Data Files<br />

SAVE writes matrices to an SPSS data file or to the current working data file. The rows of the<br />

matrix expression become cases, and the columns become variables. The syntax of the SAVE<br />

statement is as follows:<br />

SAVE matrix expression<br />

[/OUTFILE = {file reference}]<br />

{* }<br />

[/VARIABLES = variable list]<br />

[/NAMES = names vector]<br />

[/STRINGS = variable list]<br />

Matrix Expression Specification<br />

The matrix expression following the keyword SAVE is any matrix language expression that<br />

evaluates to the value(s) to be written to an SPSS data file.<br />

• The matrix specification must precede any other specifications on the SAVE statement.<br />

• You can specify a matrix name, a matrix raised to a power, or a matrix function (with its<br />

arguments in parentheses) by itself, but you must enclose other matrix expressions in<br />

parentheses. For example, SAVE A, SAVE INV(A), or SAVE B**DET(T(C)*D) is<br />

legal, but SAVE A+B is not. You must specify SAVE (A+B).<br />

• Constant expressions are allowed.<br />

OUTFILE Specification<br />

OUTFILE designates the file to which the matrix expression is to be written. It can be an actual<br />

filename in apostrophes or quotation marks, or a file handle defined on a FILE HANDLE<br />

command that precedes the matrix program. The filename or handle must be a valid file<br />

specification.<br />

• To save a matrix expression as the working data file, specify an asterisk (*). If there is no<br />

working data file, one will be created; if there is one, it is replaced by the saved matrices.<br />

• The OUTFILE specification is required on the first SAVE statement in a matrix program (first<br />

in order of appearance, not necessarily in order of execution). If you omit the OUTFILE specification<br />

from a later SAVE statement, the statement uses the most recently named file (in<br />

order of appearance) on a SAVE statement in the same matrix program.

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

Saved successfully!

Ooh no, something went wrong!