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.

Logical Operators<br />

MATRIX—END MATRIX 923<br />

Logical operators combine two matrices, normally containing values of 1 (true) or 0 (false).<br />

When used with other numerical matrices, they treat all positive values as true and all negative<br />

and 0 values as false. The logical operators are:<br />

NOT Reverses the truth of the matrix that follows it. Positive elements yield 0, and negative<br />

or 0 elements yield 1.<br />

AND Both must be true. The matrix A AND B is 1 where the corresponding elements of<br />

A and B are both positive, and 0 elsewhere.<br />

OR Either must be true. The matrix A OR B is 1 where the corresponding element of<br />

either A or B is positive, and 0 where both elements are negative or 0.<br />

XOR Either must be true, but not both. The matrix A XOR B is 1 where one, but not both,<br />

of the corresponding elements of A and B is positive, and 0 where both are positive<br />

or neither is positive.<br />

Precedence of Operators<br />

Parentheses can be used to control the order in which complex expressions are evaluated.<br />

When the order of evaluation is not specified by parentheses, operations are carried out in the<br />

order listed below. The operations higher on the list take precedence over the operations lower<br />

on the list.<br />

+– (Unary)<br />

:<br />

** &**<br />

*&*&/<br />

+– (Addition and Subtraction)<br />

>>=

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

Saved successfully!

Ooh no, something went wrong!