SPSS TUTORIALS FULL COURSE BASICS ANOVA REGRESSION FACTOR

# SPSS Data Preparation 6 – Inspect Cases

## 9. Missing Values per Case

(Overview and data file are are found here)

Missing values complicate some analyses or may sometimes indicate that respondents didn't fill out the questionnary very seriously. In any case, it's a good idea to at least check how missing values are distributed over respondents and we often do so for sections of variables separately. Do make sure that user missing values have been properly specified for all relevant variables.
As an example, we'll count missing values over q2 to q5 with the syntax below.

## SPSS Missing Values Per Case Syntax

*1. Specify 6 as user missing value for relevant variables.

missing values q2 to q5 (6).

*2. Compute variable mis_1, holding number of missing values over q2 to q5.

compute mis_1 = nmiss(q2 to q5).

*3. Apply variable label to mis_1.

variable labels mis_1 "Number of missing values over q2 to q5".

*4. Inspect frequency table of mis_1.

frequencies mis_1.

## Result

Note that 2 respondents have missing values on all 4 variables and 1 has 3 missing values. If we want to visually inspect these cases, we can easily move them to the top of data view by running sort cases by mis_1(d).

## Exclude Cases from Analysis

We decide to exclude cases with 3 or more missing values on q2 to q5 from our analyses. A great way for doing so is by FILTER. The syntax below shows how to do so in a clean and fast way.

*1. Create filter variable holding 1 for cases with mis_1 < 3 and 0 for other cases.

compute filt_1 = (mis_1 < 3).

*2. Apply label to filter variable.

variable labels filt_1 "Case has less than 3 missing values over q2 to q4".

*3. Filter by new filter variable.

filter by filt_1.

*4. Confirm filter works properly.

frequencies mis_1.

## Result

Note that the three cases with 3 or more missing values no longer appear in the output; instead of 601 cases, 598 cases are now reported on. Also note the strikethrough in data view for the cases that have been excluded by FILTER.

For now, we'll reinclude the excluded cases by simply running filter off. Note that this obviously makes the aforementioned strikethrough disappear as well.

# Tell us what you think!

*Required field. Your comment will show up after approval from a moderator.

# THIS TUTORIAL HAS 4 COMMENTS:

• ### By atay on May 22nd, 2016

In the blue box under "Exclude Cases from Analysis" it says:

variable labels filt_1 "Case has less than 3 missing values over q2 to q4".

I believe it should have read as: "... q2 to q4".

Thank you very much for the tutorial.

• ### By Danny on May 9th, 2017

SPSS NMISS function failed . look at case ID 2015701, it has no missing from q1 to q5 but the command below shows one missing.

compute mis_1 = nmiss(q2 to q5).

• ### By Ruben Geert van den Berg on May 9th, 2017

Hi Danny!

This case has a user missing value on q2: 6 ("no answer"). NMISS includes both system and user missing values.

• ### By Danny on May 9th, 2017

Hi Ruben,

You're absolutely right. I pasted the data into Stata with different result but forgotten the user defined 6 as missing. Thx.