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.

MSAVE Statement: Writing SPSS Matrix Data Files<br />

MATRIX—END MATRIX 953<br />

The MSAVE statement writes matrix expressions to an SPSS matrix-format data file that can<br />

be used as matrix input to other SPSS procedures. (See MATRIX DATA for a discussion of<br />

matrix-format data files.) The syntax of MSAVE is as follows:<br />

MSAVE matrix expression<br />

/TYPE = {COV }<br />

{CORR }<br />

{MEAN }<br />

{STDDEV}<br />

{N }<br />

{COUNT }<br />

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

{* }<br />

[/VARIABLES = variable list]<br />

[/SNAMES = variable list]<br />

[/SPLIT = split vector]<br />

[/FNAMES = variable list]<br />

[/FACTOR = factor vector]<br />

• Only one matrix-format data file can be saved in a single matrix program.<br />

• Each MSAVE statement writes records of a single rowtype. Therefore, several MSAVE statements<br />

will normally be required to write a complete matrix-format data file.<br />

• Most specifications are retained from one MSAVE statement to the next so that it is not<br />

necessary to repeat the same specifications on a series of MSAVE statements. The exception<br />

is the FACTOR specification, as noted below.<br />

Example<br />

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

MSAVE S /TYPE STDDEV.<br />

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

MSAVE C /TYPE CORR.<br />

• The series of MSAVE statements save the matrix variables M, S, and C, which contain,<br />

respectively, vectors of means and standard deviations and a matrix of correlation coefficients.<br />

The SPSS matrix-format data file thus created is suitable for use in a procedure such<br />

as FACTOR.<br />

• The first MSAVE statement saves M as a vector of means. This statement specifies OUTFILE,<br />

a previously defined file handle, and VARIABLES, a list of variable names to be used in the<br />

SPSS data file.<br />

• The second MSAVE statement saves S as a vector of standard deviations. Note that the<br />

OUTFILE and VARIABLES specifications do not have to be repeated.<br />

• The third MSAVE statement saves a vector of case counts. The matrix function MAKE<br />

constructs an eight-element vector with values equal to the case count (24 in this example).<br />

• The last MSAVE statement saves C, an 8 ×<br />

8 matrix, as the correlation matrix.<br />

Matrix Expression Specification<br />

• The matrix expression must be specified first on the MSAVE statement.

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

Saved successfully!

Ooh no, something went wrong!