Labeling Variables and Data Values
A variable label gives more information about the content of a variable than the 8-character variable name can provide. Value labels indicate the meaning of data values where these are not evident. Even though both types of labels often are defined during the step of building a new data file, they also may be defined, or existing labels may be changed, later on with the help of commands.
Example for variable labels:
VAR LAB incom 'Net household income in DM' | |
/ nhhm 'Number of household members'. |
As you might expect, VARIABLE LABELS
would do as well.
Example for value labels:
VAL LAB emplst1 emplst2 | |
1 'Full time (31 hrs. or more)' | |
2 'Part time (10-30 hrs.)' | |
3 'Irregular (less than 10 hrs.)' | |
4 'Unemployed' | |
5 'Retired' | |
6 'Houseperson'. |
The long version VALUE LABELS
will also work.
Example for adding value labels:
ADD VAL LAB emplst1 emplst2 | |
4 'Retired' | |
5 'Unemployed' | |
7 'Vocational training' | |
8 'Military service'. |
Variable labels can be up to 120 characters long. However, usually far fewer characters are displayed in the output; in most cases, 40-60 characters would be a good choice. You can label several variables with a single VAR LAB
command, but variables-plus-labels must be separated by slashes as shown in the example above. This holds true even if you want to give the same label to a number of variables (which admittedly will occur only rarely).
Value lables can have up to 60 characters; again, usually fewer characters are displayed, and 16 characters are recommended. If several variables have the same value labels, all of these variables can be enumerated in a single VAL LAB command.
Note that with both commands, single as well as double quotes can be used. Be sure not the mix up single quotes with accents; the latter are not recognized by SPSS.
Both the VAR LAB
and the VAL LAB
command override previous definitions of labels; however, in the case of value labels the ADD VAL LAB command may help. It may be used to do what it says, but also to change part of the previously defined labels, as in the example above.
© W. Ludwig-Mayerhofer, IGSW | Last update: 07 May 2011