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:
SUMMARIZE
/TABLES=OldVar1 OldVar2 NewVar
/FORMAT=LIST NOCASENUM TOTAL LIMIT=100
/TITLE=’Case Summaries’
/MISSING=VARIABLE
/CELLS=COUNT.
Leave a Reply