This is because SPSS, by default, recognizes "blank" strings as valid values.
It also automatically adds value labels: whatever the string value was before becomes the value label.Īdditionally, if you have used blanks to indicate missing values for string variables, you may have noticed that SPSS doesn't automatically recognize those observations as missing. If you have already recorded your categorical variables as strings, you can easily convert them to a labeled, numerically coded variable using the Automatic Recode procedure. This procedure assigns each unique category a numeric code, then saves the converted values as a new variable. Mismatch (notice the extra space after string 1) (Note that if your data was originally recorded in Excel, it is very easy for the values of string variables to accidentally be recorded with extra spaces at the end.) String 1 This includes placing an extra space at the end of a string: the human eye won't detect the discrepancy, but the computer will.
This is because, when referring to the content of a string during a computation, the content must match exactly. If the content of the two strings is not an exact match, the computer will not recognize them as identical. Either method of recording categorical variables is valid, but it is often easier to work with numeric codes in SPSS than it is to work with strings. When writing down the observed values of a categorical variable, you can choose to write the data values as words or as numeric codes.