Vous êtes sur la page 1sur 2

CHAPTER 19

SELECTING CASES
The SELECT CASES procedure is used to limit an analysis to only a specified subset of cases. The
subset is chosen on the basis of some criterion. For instance, if you have data from a set of
questionnaires filled out by freshmen, sophomores, juniors and seniors, you can "select" only
respondents who are seniors (presuming you have a variable for "year in school"). Only those cases
selected are available for processing by SPSSWIN. In other words, the selection criterion acts as a filter
- and it remains in effect until all cases are again selected for processing (that is, you "turn off" SELECT
CASES).
To SELECT a subset of cases
1.

From the DATA Menu click on SELECT CASES

2.

The SELECT CASES Dialog Box will appear. Click on the If condition is satisfied radio button.
Then click on the IF pushbutton.

3.

The SELECT CASES: IF Dialog Box will appear. You will notice its similarity to the COMPUTE
Dialog Box. You build a conditional statement in the same fashion as was done for IF CASES.

4.

Click on a variable from the Variable list that you wish to use as a criterion. Then press the (>)
arrow button. The variable name appears in the conditional expression box. Then, using the
calculator pad, complete the expression.
Some conditional expressions might include:
V1 = 1
V1 <= 2 & V5 = 2
V1 >= 3 & V1 <= 5
V22 = 1 | V22 = 9

5.

Whatever the conditional expression, each case will be tested against it. If, for a case, the
expression is true, the case will be available for processing. If, for a case, the expression is
false, the case will be filtered out and unavailable for processing.

6.

When you are satisfied with the conditional expression, click on the Continue pushbutton. Then,
click on the OK button in the SELECT IF Dialog Box. [You might want to first PASTE the SELECT
IF command into a Syntax window.]

7.

Note that in the Data Editor window (a) all cases not selected will have a slash mark through the
line number and (b) the words filter on will appear on the status line at the bottom of the screen.
A new variable is also created: "Filter_$". It appears in the last column of the data file.

8.

To switch the filter off (that is, remove the Select Cases filter), return to the SELECT CASES
Dialog Box and click on the All Cases radio button. Thereafter, press the OK pushbutton. You
will notice that the newly created variable, "Filter_$", will remain in the data file.

Multiple Conditions
When you wish to select cases based upon multiple conditions being met, it is necessary to specify those
conditions in one conditional statement.
For instance, if you want to SELECT only those cases for which V2 =1 and V26 =1, you should write the
statement: V2 =1 & V26 =1
If, alternatively, you first selected cases based on V2=1 and clicked on OK, and then went back to
SELECT CASES and selected cases based on V26=1, only the second statement would take effect after
you clicked on OK.

Other features of SELECT CASES: IF Dialog Box


1.

Unselected cases can either be filtered out or deleted. Obviously, the latter choice should be used
with caution for, if you save the data file with this choice in effect, filtered out cases are
permanently deleted.

2.

The user can select a RANDOM SAMPLE of cases by clicking on the appropriate radio button. A
percentage or exact number of cases can be chosen from the SELECT CASES: RANDOM
SAMPLE Dialog Box. If you have a data file containing thousands of cases, you can randomly
select a subsample for analysis. If the option "Based on time or case range" is chosen, you can
select a range of cases based on their order in the Data Editor. The "Use filter variable" option
allows you to filter out cases that have a value of zero (0) on a specific variable.

3.

Cases can also be filtered by time, case range, or filter variable. Refer to SPSSWIN manual for
more information.

Exercise 8
1.

Open the file GSS91POL2.

2.

Run a Frequency analysis of the variable GETAHEAD]

3.

SELECT respondents with 11 or fewer years of school completed (using the EDUC variable).

4.

Again run a Frequency analysis of the variable GETAHEAD

5.

Paste both Frequency tables into Word.

6.

E-mail the Word document as an attachment to your instructor. Be sure "Exercise 8" appears in
the subject line of the email.

Vous aimerez peut-être aussi