SPSS tutorials


Stepwise Regression in SPSS – Data Preparation

SPSS Stepwise Regression - Goals

A magazine publisher surveyed readers on their overall satisfaction and a number of quality aspects. Their data can be downloaded from magazine.sav.
Now, when working with real world data, the first thing you want to do are some basic data checks. This tutorial walks you through. The actual regression analysis on the prepared data is covered in the next tutorial.

Check for User Missing Values and Coding

We'll first check if we need to set any user missing values. A solid approach here is to run frequency tables while showing values as well as value labels.

*Show values and value labels as well as variable names and labels in output.

set tnumbers both tvars both.

*Check for user missing values.

frequencies satov to sat9.


SPSS Stepwise Regression - Check for Using Missing Values

Set User Missing Values

We learn two things from our frequency tables. First, all variables are positively coded: higher values correspond to more positive attitudes. If this is not the case, an easy way to fix it is presented in SPSS Recode Values with Value Labels.
Second, we need to set 6 as a user missing value for our quality aspects. We'll do so with the syntax below. We'll take a look at our frequency distributions as well.

*Set user missings.

missing values sat1 to sat9 (6).

*Check coding and distributions.

frequencies satov to sat9/format notable/histogram.


SPSS Stepwise Regression - Variable Distributions

Our histograms don't show anything alarming except that many variables have rather low variances. This tends to result in rather limited correlations as we'll see in a minute.

Inspect Missing Values per Case

We'll now inspect how our missing values are distributed over cases with the syntax below.

*Inspect missings per case.

compute mis1 = nmiss(satov to sat9).

variable labels mis1 "Number of (system or user) missings over satov to sat9".

frequencies mis1.


SPSS Stepwise Regression - Missing Values per Case

Cases with many missing values may complicate analyses and we find them suspicious. But then again, we'd like to use as much of our data as possible. If we don't allow any missings, we'll lose 19% of our sample. We therefore decide to exclude only cases with 4 or more missing values.

Filter Out Cases with 4 or More Missings

*Compute filter for cases with 3 or fewer missings.

compute filt1 = (mis1 <= 3).

variable labels filt1 "Filter for 3 or fewer missings over satov to sat9".

*Switch on filter and check.

filter by filt1.

frequencies mis1.

Inspect Missing Values per Variable

We'll also take a look at how missings are distributed over our variables: do all variables have a sufficient number of valid values or do we need to exclude one or more variables from our analyses?

*Inspect missings per variable.

descriptives satov to sat9.


SPSS Stepwise Regression - Missing Values per Variable

None of our variables seems problematic. The lowest N is seen for sat6 (reliability of information). Perhaps our respondents found this aspect hard to judge.

Inspect Pearson Correlations

Last but not least, we want to make sure our correlations look plausible. We'll take a quick look at the entire correlation matrix.

*Inspect correlations.

correlations satov to sat9.

*Save edited data file for regression.

save outfile 'magazine_reg.sav'.


SPSS Stepwise Regression - Correlations

Things to watch out for are correlations in the “wrong” direction (positive where negative would make sense or reversely). This may result from some variables being positively coded and others negatively but we already saw that's not the case with our data.
Less common but very problematic are correlations close or equal to -1 or 1 which can result from (nearly) duplicate variables. This is not an issue here either.
We're now good to go for our regression analysis. Since we created a filter variable, we'll save our data as magazine_reg.sav. We'll use this file as input for our next tutorial.

Previous tutorial: SPSS Multiple Regression Analysis Tutorial

Next tutorial: Stepwise Regression in SPSS – Example

Let me know what you think!

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

This tutorial has 4 comments