(Overview and data file are are found here)
SPSS has two variable types: string variables and numeric variables. String variables have “String” under Type in . All other variables are numeric. The screenshot below illustrates this point for hotel_evaluation.sav.
3. Undesirable Variable Types
A problem with some data files is that they contain string variables that should have been numeric. A rule of thumb is that only nominal variables with many distinct values should be string variables. Right. In we see that fname, bday, age and q1 are string variables. The screenshot below shows them in .
First, fname holds respondents’ first names. Is it nominal? Yes. Does it have many different values? Yes. Conclusion: it's an appropriate string variable. No problem here.
Second, bday holds respondents’ birthdays. Is it nominal? No. Conclusion: this should have been a numeric variable. More precisely, it should be a date variable (which is also a numeric variable). Solution: convert it. Convert String to Date Variable shows how to do so but we'll skip that for now.
Third, age is also a metric instead of a nominal variable and thus had better be converted to numeric as well. We'll cover this in SPSS Convert String to Numeric Variable but we'll skip it for now.
Fourth, q1 appears to be an ordinal variable. It's not nominal and it doesn't have many distinct values either so it's not a proper string variable. A labeled numeric variable (similar to q2 for example) would be appropriate here. For now, we'll skip converting it.
THIS TUTORIAL HAS 3 COMMENTS:
By D Hayes on February 2nd, 2017
Thanks very much for this website, it is a great help for refreshing my use of SPSS after getting rusty, and clarifying concepts that were skipped over the first time around.
If I have a nominal variable, say presence/absence (1/0), I take it this should be assigned as a numeric variable?
When selecting cases I notice SPSS only allows you to to select numeric variables, and I definitely want to select those present rather than those absent!
(The reason this variable exists is that the data is from a long term study with multiple time points, so specifying presence at a given time is crucial).
By Ruben Geert van den Berg on February 2nd, 2017
Thanks for the compliment!
SPSS originally had only syntax and the way the menu's been built upon that is sometimes far from optimal.
What do you mean by "selecting cases"? For deleting unwanted cases, use SELECT IF. For filtering out unwanted cases, use FILTER.
There's no real need to convert your string into numeric for using either command but doing so tends to facilitate most of what you usually want to do with such variables. See AUTORECODE for an easy option for doing so.
Hope that helps!
By Genesis David on July 26th, 2022
Thank you, very much