SELECTING CASES in SPSS
Sometimes a researcher may wish to restrict an analysis to only a subset of the data file. For example, a researcher might want to do an analysis on only the female participants, only on American citizens, or only on those who disagreed with a presented message. You can have SPSS only perform analyses on a subset of cases meeting specified criteria by selecting cases.

For example, suppose you believed that an experimental manipulation would work better on female participants. You might therefore want to do an analysis only on the female participants. Assuming that you had a variable named gender in your data set where men had a value of 1 and women had a value of 2, you could select only women for analysis in SPSS by taking the following steps

Choose Data then Goto Select Cases.
Click the radio button next to If condition is satisfied.
Click the If button.
Type gender = 2 in the popup window.
Click the Continue button.
Click the OK button.

After running this procedure, the dataset will have slashes crossing out the cases that are excluded (in this case, it should cross out all the male participants). Any further analyses on this data set (until you issue another Select Cases command or load another data set) will be performed solely on the female participants.

An analyst can restrict the data set in more complicated ways by using the Boolean operator AND (represented by the symbol &) or the Boolean operator OR (represented by the symbol |). The & symbol tells SPSS that a case has to meet two specific criteria to be included in the analysis, while the | symbol tells SPSS that it should include a case if it meets either of two criteria. As an example, let us assume that the data set included a variable named class where 1 = freshmen, 2 = sophomore, 3 = junior, and 4 = senior. If we only wanted to include cases that represented female juniors we would perform the following steps.

Choose Data then Goto Select Cases.
Click the radio button next to If condition is satisfied.
Click the If button.
Type (gender=2) & (class=3) in the popup window.
Click the Continue button.
Click the OK button.

If we wanted to include cases that were either female or juniors (so that the analysis would include all females and any males who happened to be juniors) we would take the following steps.

Choose Data then Goto Select Cases.
Click the radio button next to If condition is satisfied. Click the If button.
Type (gender=2) | (class=3) in the popup window.
Click the Continue button.
Click the OK button.

You may notice that one of the buttons on the selection keypad looks like ~=. This symbol stands for .not equal to.. Sometimes it is easier to identify what cases to exclude than it is to identify what cases to include. For example, you could select everyone in the data set except sophomores by taking the following steps.

Choose Data then Goto Select Cases.
Click the radio button next to If condition is satisfied.
Click the If button.
Type class~=2 in the popup window.
Click the Continue button.
Click the OK button.