Description:
Hello, and welcome to this tutorial on using value labels in NCSS. In this tutorial we’ll explain what value labels are, how to create them, and how to use them in reports and plots. The example dataset we’ll use contains responses to a survey from 15 individuals, along with some personal information.
Value labels can be displayed in reports and plots in place of the actual data values to make the report easier to interpret. For example, you might be tabulating survey data such as that in our example dataset in which the values “Yes” and “Male” were coded as a 1’s and “No” and “Female” were coded as 0’s. The resulting tabulation report would be much more readable if “Yes”, “No”, “Male”, and “Female” were displayed rather than 1’s and 0’s. One way to accomplish this would be to generate a new data column, replacing the 1’s and 0’s with “Yes”, “No”, “Male”, and “Female”, but a simpler approach would be to use Value Labels.
Value labels are easy to create using the Value Label Editor tool. Click in the column for which you would like to enter the value labels, and then load the Value Label Editor using the Data menu. Alternatively, open the Column Info Table, select the cell with the value labels heading that corresponds to the appropriate column, and then click on the small button at the right side of the highlighted cell to load the tool window.
Value labels can be specified for a column using a simple List, a Named List, or using a Value Label Text File. We’ll explain each method in this tutorial.
The list is the simplest method for inputting value labels. Use this option to enter value labels that are unique to a single column in the dataset. In the table on the Value Label Editor window, simply enter values in the first column and corresponding labels in the second column. You can click the Get Unique Values button to quickly fill in the list of unique values for the selected column. Once the values and labels are entered, click OK. The Value Label Editor will return a properly-formatted value label list to the Column Info Table.
You can enter and edit value labels directly on the Column Info Table using the syntax value equals label, with pairs separated by commas. If you are using a computer language setting other than English that uses a comma as the decimal symbol, then the list should be separated by the computer’s specified list separator which is usually a semicolon. If a value or label includes a space, you should enclose the entire value or label in double quotes. At any time you can reload the Value Label Editor to edit the value labels.
You can show the value labels directly on the Data Table using the display option in the View menu. The label associated with each value will be displayed instead of the value itself. The underlying data values, however, are not changed. For example, when you use the copy function on cells that display value labels, the actual values, not the labels, will be copied. If you edit a cell in a column displaying value labels, you should enter the value, not the label.
Now that we have created and associated value labels with columns on the dataset, we still need to activate them using the procedure window prior to generating a report. If they are not activated, they won’t be displayed in reports and plots even though they have been entered on the Column Info Table. To activate the value labels, click on the Report Options tab on the procedure window and change the selection for Value Labels from Data Values to Value Labels. As a side note, the same type of thing must be done here to activate column labels in the report. Let’s go ahead and activate those as well.
With the value labels activated, let’s now run the procedure to generate the report. As you can see, it’s much easier to interpret this report with value labels added.
As I mentioned earlier, there are two other ways to enter values labels for use with a dataset. The named list is particularly useful when you want to use the same value labels in more than one column. The named list is the same as the simple list, except that it is referenced on the Column Info Table by its name, not its content. If you change the values or labels in a named list, the changes will apply to all columns that use it. Named lists are stored as part of dataset.
You create a named list using the Value Label Editor exactly the same way you create a simple list. In the table on the editor window, simply enter values in the first column and corresponding labels in the second column. Click OK and the Value Label Editor will return an appropriate reference to the named list.
The third method to associate value labels with a data column is to use a value label file. Value label files are useful when you have value labels stored in separate text files to be used with multiple NCSS data files. Values label files are easily constructed using Windows Notepad or some other text editor. The files should contain a list of values and their corresponding labels, separated by tabs, with one set per row.
To label values in a column using a value label file, select File on the Value Label Editor window, and then click Browse to select the value label file located on your computer or network. The file name and path will be displayed in the File Name box. Select how to reference the file and click OK. The editor will return an appropriate reference to the value label file in the Column Info Table.