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.

924 MATRIX—END MATRIX<br />

• The results of these COMPUTE statements are:<br />

A<br />

D<br />

MATRIX and Other SPSS <strong>Command</strong>s<br />

A matrix program is a single procedure within an SPSS session.<br />

• No working data file is needed to run a matrix program. If one exists, it is ignored during<br />

matrix processing unless you specifically reference it (with an asterisk) on the GET, SAVE,<br />

MGET, or MSAVE statements.<br />

• Variables defined in the SPSS working data file are unavailable during matrix processing,<br />

except with the GET or MGET statements.<br />

• Matrix variables are unavailable after the END MATRIX command, unless you use SAVE or<br />

MSAVE to write them to the working data file.<br />

• You cannot run a matrix program from a syntax window if split-file processing is in effect.<br />

If you save the matrix program into a syntax file, however, you can use the INCLUDE<br />

command to run the program even if split-file processing is in effect.<br />

Matrix Statements<br />

=<br />

123<br />

B<br />

456<br />

=<br />

2 4 8<br />

E<br />

16 32 64<br />

Table 2 lists all of the statements that are accepted within a matrix program. Most of them<br />

have the same name as an analogous SPSS command and perform an exactly analogous<br />

function. Use only these statements between the MATRIX and END MATRIX commands. Any<br />

command not recognized as a valid matrix statement will be rejected by the matrix processor.<br />

Table 2 Valid matrix statements<br />

BREAK ELSE IF MSAVE<br />

CALL END IF PRINT<br />

COMPUTE END LOOP READ<br />

DISPLAY GET RELEASE<br />

DO IF LOOP SAVE<br />

ELSE MGET WRITE<br />

Exchanging Data with SPSS Data Files<br />

=<br />

56 7<br />

C<br />

8910<br />

=<br />

111<br />

F<br />

100<br />

1 4 9<br />

16 25 36<br />

Matrix programs can read and write SPSS data files.<br />

• The GET and SAVE statements read and write ordinary (case-oriented) SPSS data files,<br />

treating each case as a row of a matrix and each ordinary variable as a column.<br />

=<br />

=<br />

111<br />

000

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

Saved successfully!

Ooh no, something went wrong!