SPSS Tutorials

BASICS REGRESSION T-TEST ANOVA CORRELATION

SPSS – Set Missing Values with Syntax

When working with SPSS, specifying missing values correctly is often an essential step in analyzing data. This tutorial demonstrates how to set missing values the right way.

Setting Missing Values in SPSS

SPSS Missing Values Syntax Examples

(The test data used by the syntax below are found here.)

*1. Specifying 4 and 5 as missing values for "married".

missing values married(4,5).

*2. Specify a range (1,000,000 and upwards) as missing values for "income".

missing values income (1000000 thru hi).

*3. Specify 2 as missing value for variables q1 through q3.

missing values q1 to q3 (2).

Changing Columns in SPSS

SPSS Variable Width Syntax Example

(The test data used by the syntax below are found here.)

*Set columns = 50 for q1 through q3..

variable width q1 to q3 (50).

Changing Variable Alignment in SPSS

SPSS Variable Align Syntax Example

(The test data used by the syntax below are found here.)

*Set Variable Alignment = center for q1 through q3.

variable alignment q1 to q3 (center).

Changing Measurement Levels in SPSS

SPSS Variable Level Syntax Example

(The test data used by the syntax below are found here.)

*Set measurement level to scale for "birthday", ordinal for "married" and nominal for q1 through q3.

variable level birthday(scale) married(ordinal) q1 to q3 (nominal).

Changing Roles in SPSS

SPSS Variable Role Syntax Example

(The test data used by the syntax below are found here.)

*Set role to input for "married", target for "income" and both for "q1" through "q3".

variable role
/input married
/target income
/both q1 to q3.

Previous tutorial: Changing Variable Properties 4 – Width and Decimals

Next tutorial: SPSS – Set Variable Labels with Syntax

Let me know what you think!

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

This tutorial has 10 comments