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 955<br />

• You cannot specify the reserved names ROWTYPE_ and VARNAME_ on the VARIABLES<br />

specification.<br />

• If you omit the VARIABLES specification, the default names COL1, COL2,..., etc., are used.<br />

FACTOR Specification<br />

To write an SPSS matrix-format data file with factor or group codes, you must use the FACTOR<br />

specification to provide a row matrix containing the values of each of the factors or group variables<br />

for the matrix expression being written by the current MSAVE statement.<br />

• The factor vector must have the same number of columns as there are factors in the matrix<br />

data file being written. You can use a scalar when the groups are defined by a single<br />

variable. For example, FACTOR=1 indicates that the matrix data being written are for the<br />

value 1 of the factor variable.<br />

• The values of the factor vector are written to the matrix-format data file as values of the<br />

factors in the file.<br />

• To create a complete matrix-format data file with factors, you must execute an MSAVE statement<br />

for every combination of values of the factors or grouping variables (in other words,<br />

for every group). If split-file variables are also present, you must execute an MSAVE statement<br />

for every combination of factor codes within every combination of values of the splitfile<br />

variables.<br />

Example<br />

MSAVE M11 /TYPE=MEAN /OUTFILE=CORRMAT /VARIABLES=V1 TO V8<br />

/FNAMES=SEX, GROUP /FACTOR={1,1}.<br />

MSAVE S11 /TYPE STDDEV.<br />

MSAVE MAKE(1,8,N(1,1)) /TYPE N.<br />

MSAVE C11 /TYPE CORR.<br />

MSAVE M12 /TYPE=MEAN /FACTOR={1,2}.<br />

MSAVE S12 /TYPE STDDEV.<br />

MSAVE MAKE(1,8,N(1,2)) /TYPE N.<br />

MSAVE C12 /TYPE CORR.<br />

MSAVE M21 /TYPE=MEAN /FACTOR={2,1}.<br />

MSAVE S21 /TYPE STDDEV.<br />

MSAVE MAKE(1,8,N(2,1)) /TYPE N.<br />

MSAVE C21 /TYPE CORR.<br />

MSAVE M22 /TYPE=MEAN /FACTOR={2,2}.<br />

MSAVE S22 /TYPE STDDEV.<br />

MSAVE MAKE(1,8,N(2,2)) /TYPE N.<br />

MSAVE C22 /TYPE CORR.<br />

• The first four MSAVE statements provide data for a group defined by the variables SEX and<br />

GROUP, with both factors having the value 1.<br />

• The second, third, and fourth groups of four MSAVE statements provide the corresponding<br />

data for the other groups, in which SEX and GROUP, respectively, equal 1 and 2, 2 and 1,<br />

and 2 and 2.<br />

• Within each group of MSAVE statements, a suitable number-of-cases vector is created with<br />

the matrix function MAKE.

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

Saved successfully!

Ooh no, something went wrong!