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.

1480 SELECT IF<br />

Missing Values<br />

• If the logical expression is indeterminate because of missing values, the case is not selected.<br />

In a simple relational expression, a logical expression is indeterminate if the expression on<br />

either side of the relational operator is missing.<br />

• If a compound expression is used in which relations are joined by the logical operator OR,<br />

the case is selected if either relation is true, even if the other is missing.<br />

• To select cases with missing values for the variables within the expression, use the<br />

missing-value functions. To include cases with values that have been declared usermissing<br />

along with other cases, use the VALUE function (see p. 53 in Volume I).<br />

Limitations<br />

Example<br />

Example<br />

SELECT IF cannot be placed within a FILE TYPE—END FILE TYPE or INPUT PROGRAM—END<br />

INPUT PROGRAM structure. It can be placed nearly anywhere following these commands in<br />

a transformation program. See Appendix A for a discussion of program states and the placement<br />

of commands.<br />

SELECT IF (SEX EQ ’MALE’).<br />

• All subsequent procedures will use only cases in which the value of SEX is MALE.<br />

• Since upper and lower case are treated differently in comparisons of string variables, cases<br />

for which the value of SEX is male are not selected.<br />

SELECT IF (INCOME GT 75000 OR INCOME LE 10000).<br />

• The logical expression tests whether a case has a value either greater than 75,000 or less<br />

than or equal to 10,000. If either relation is true, the case is used in subsequent analyses.<br />

Example<br />

SELECT IF (V1 GE V2).<br />

• This example selects cases where variable V1 is greater than or equal to V2. If either V1<br />

or V2 is missing, the logical expression is indeterminate and the case is not selected.

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

Saved successfully!

Ooh no, something went wrong!