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.

10 Universals<br />

than 69, use RECODE in the DO IF—END IF structure to selectively recode 0 to a negative<br />

number and declare the negative number as missing:<br />

MISSING VALUES INCOME EXPENSES (-1).<br />

DO IF (AGE>69).<br />

RECODE INCOME EXPENSES (0=-1).<br />

END IF.<br />

COMPUTE PROFILE=INCOME-EXPENSES.<br />

LIST.<br />

In addition, the order of transformations that take effect immediately in the command<br />

sequence can be misleading. Consider the following:<br />

COMPUTE PROFIT=INCOME-EXPENSES.<br />

MISSING VALUES INCOME EXPENSES (0).<br />

LIST.<br />

• COMPUTE precedes MISSING VALUES and is processed first; however, execution is<br />

delayed until the data are being read.<br />

• MISSING VALUES takes effect as soon as it is encountered.<br />

• LIST causes the data to be read; thus, SPSS executes both COMPUTE and LIST during the<br />

same data pass. Because MISSING VALUES is already in effect by this time, all cases with<br />

the value 0 for either INCOME or EXPENSES return a missing value for PROFIT.<br />

To prevent the MISSING VALUES command from taking effect before COMPUTE is executed,<br />

you must position MISSING VALUES after the LIST command. Alternatively, place an<br />

EXECUTE command between COMPUTE and MISSING VALUES.

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

Saved successfully!

Ooh no, something went wrong!