The best way to make sure that your data set is readable both by machines and by
humans is to use labels for your data. There are two important types of labels
used in IBM SPSS Statistics: variable labels and value labels. We are going to
dive deeper into how to label your variables in SPSS.
We want to make our data set easily interpretable, so we will add some labels
to our variables. First, we will add value labels to categorical variables.
Our nominal variable "Gender" has been coded 1 and 2. The machine can use this
coding, but what we humans need to know is "who is male and who is female?"
Click on Values. We get the value labels dialog box. For the value of 1, add the
label "Male", and click Add. For the value of 2, add the label "Female"... Add, and
click OK. In Data View, we can now toggle between numeric values
and value labels. The value labels are easier for us to interpret and any
analysis that you do in SPSS will work exactly the same regardless of whether
we view value labels or the actual values.
The variable "marital status" has been coded as a string variable. Can we
reverse the process that we used with gender and just label married as 1 and
single as 2? Unfortunately not. We cannot change the data by changing the
labels, but the good news is that we do not have to. Provided that you have
spelled each string entry the same, you can still use them in an analysis. If we
we're doing a t-test, for example, we could make Group 1 equal
"single" and Group 2 equal "married", and the t-test will still run. Or we could do
an ANOVA between the groups single, married, and divorced, without having to
do any additional coding. It is also a good idea to use a frequency table to
check that all of the strings have been spelled the same. If necessary, do the
data cleaning to make sure that the spelling is consistent.
In addition to defining the variable types, you can also add descriptive
labels to each of your variables. The value labels like "male" and "female" define
the levels of a categorical variable. Variable labels describe the variable
itself and make the data set easier for humans to interpret. Variable labels tend
to be longer versions of the variable name. These labels will also appear in
the output to identify the variables. Some variables like "age" and "gender" are
self-explanatory, so you may choose to not add a label. Others, like "marital"
or "income" might benefit from a little more clarity. For the Marital variable,
type "Marital status" and for the Income variable type "Household income in
thousands." Err on the side of using more labels than you think necessary. Someday
in the future, you will look at this data set and wonder what those short variable
names meant. But Future You will be eternally grateful that Current You has
added plenty of labels for Future You to decipher. And finally, here is one more
way to examine your new variables: Go to Analyze -> Reports ->Codebook. Move over all
of the variables, and then click OK. By looking at the Codebook, you can now see
details about the variables and make choices about how to use them in your
analysis.