# SPSS Tutorials

BASICS REGRESSION T-TEST ANOVA CORRELATION

# SPSS Missing Values Functions

Most real world data contain some (or many) missing values. It's always a good idea to inspect the amount of missingness for avoiding unpleasant surprises later on. In order to do so, SPSS has some missing values functions that are mostly used with COMPUTE, IF AND DO IF. This tutorial demonstrates how to use them effectively. We'll do so by using the last 5 variables in hospital.sav.

## Setting User Missing Values

Before discussing SPSS missing values functions, we'll first set 6 as a user missing value for the last 5 variables by running the line of syntax below. missing values doctor_rating to facilities_rating (6).

## SPSS Missing Values Functions

ExpressionMeaningReturns
MISSINGEvaluate whether value is system missing or user missingTrue or false
SYSMISEvaluate whether value is system missingTrue or false
NMISSReturn number of missing values over variablesNumeric value
NVALIDReturn number of valid values over variablesNumeric value

## SPSS MISSING Function

SPSS MISSING function evaluates whether a value is missing (either a user missing value or a system missing value). For example, we'll flag cases that have a missing value on doctor_rating with the syntax below.If the COMPUTE command puzzles you, see Compute A = B = C for an explanation.

*1. Flag cases having a missing value on doctor_rating.

compute mis_1 = missing(doctor_rating).

*2. Move flagged cases to top of file.

sort cases mis_1 (d).

## SPSS SYSMIS Function

SPSS SYSMIS function evaluates whether a value is system missing. For example, the syntax below uses IF to replace all system missing values by 99. We'll then label it, specify it as user missing and run a quick check with FREQUENCIES.

*1. Change system missing values to 99.

if sysmis(doctor_rating) doctor_rating = 99.

add value labels doctor_rating 99 'Recoded system missing value'.

*3. Specify 6 and 99 as user missings.

missing values doctor_rating (6,99).

*4. Quick check.

frequencies doctor_rating.

## SPSS NMISS Function

SPSS NMISS function counts missing values within cases over variables. Cases with many missing values may be suspicious and you may want to exclude them from analysis with FILTER or SELECT IF. The syntax runs a quick scan for such cases.

*1. Compute variable indicating missings per case.

compute mis_2 = nmiss(doctor_rating to facilities_rating).

*2. Apply variable label. Tip: indicate number of variables involved here.

variable labels mis_2 'Number of missing values over doctor_rating to facilities_rating (5 variables)'.

*3. Quick check.

frequencies mis_2.

## SPSS NVALID Function

SPSS NVALID function counts the number of valid values over variables. It is equivalent to the number of variables minus NMISS over those variables. Note that the dot operator is a faster alternative for excluding cases from statistical functions (such as MEAN and SUM).

*Count valid values over doctor_rating to facilities_rating (5 variables).

compute valid_1 = nvalid(doctor_rating to facilities_rating).
exe.

# Let me know what you think!

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

# This tutorial has 2 comments

• ### By Dan on November 1st, 2017

Very informative on missing values in spss,thank you.

• ### By rudy g. perez on December 3rd, 2014

very good presentations.