Using Case Summaries in SPSS to Debug your Variable Creation

by Karen Grace-Martin

Here’s a little SPSS tip.

When you create new variables, whether it’s through the Recode, Compute, or some other command, you need to check that it worked the way you think it did.

(As an aside, I hope this goes without saying, but never, never, never, never use Recode into Same Variable.  Always Recode into Different Variable so you don’t overwrite your data and then discover you made a mistake.  Or worse, not discover.  It happens).

And the easiest way to do that is to simply look at the data.  You need to look at the values of the new variable along with the variables you created it from.    Work your way through the variable creation logic and make sure you got the values you should be getting.

To do this, you need your old and new variables next to each other.  This is tricky to do in the data spreadsheet if the variables you’re creating from are way back in a huge data set.

A much easier approach is to use the SUMMARIZE command.  All it does is list out the data for the variables you tell it to.

You can do it through the menus using:

Analyze–>Reports–>Case Summaries

Just list your newly created variable along with the ones you used to create it in the Variables box.

The default is to list only the first 100 cases, so you don’t end up with a ginormous table if you have a large data set.  But you can easily change this up or down, depending on whether you need more or fewer cases to check your logic.

This is the syntax to do the same thing:

/TABLES=OldVar1 OldVar2 NewVar
/TITLE=’Case Summaries’

Want to learn more? If you’re just getting started with data analysis in SPSS, or would like a thorough refresher, please join us in our online workshop Introduction to Data Analysis in SPSS.

Bookmark and Share

Getting Started with SPSS Syntax
Do you want to know how to use SPSS syntax for data manipulation and analyses? You will witness all the advantages that come with using syntax, especially one that is already built-in.

Leave a Comment

Please note that, due to the large number of comments submitted, any comments on problems related to a personal study/project will not be answered. We suggest joining Statistically Speaking, where you have access to a private forum and more resources 24/7.

Previous post:

Next post: