When analyzing numeric data (i.e. Age in years or Income in $), you may want to create categories from these value to analyze vs using the numeric values themselves. You can group values together directly on a table in Displayr to achieve this (though there are other methods available too). Keep in mind though, that if a value within a band is missing, if the value appears in the data in a later update, it will not be automatically grouped into a category. This article describes how to go from a numeric variable represented in aggregate on a table:
To a categorical variable showing numeric bands (e.g., 0, 1-5, 6-10, 11+) for analysis purposes:
Requirements
- A variable Structured as one of the following:
- Numeric - they have a "2" next to them in the Data Sets tree:
- A categorical variable structured as Nominal or Ordinal. If there is text involved with the value label (eg, 0 – Not at all likely and 10 – Extremely Likely are the endpoints of your scale). If using this type of variable, it is prudent to check the Values so that they align correctly with the labels. The Values button is located in the Data tab of the object inspector, as shown in the picture below. You don’t want a value of 1 ascribed to 0 - Not at all likely and so forth (it should be a value of 0). You should change it so that the correct value aligns with the label.
Method - Using Drag and Drop
- [Optional] If your variable is Numeric, right-click on the variable in the Sources Menu > Duplicate to create a copy of the variable. Change the Structure to Nominal (or Ordinal) in the object inspector > General > Structure.
- Drag your categorical variable onto the page to make a table.
- Select the categories you want to band together (using Ctrl or Shift) and drag the stacked brick icon onto the last number in the band until you see the word Merge appear.
- To give the banding a correct label, right-click on the row header > Rename.
Method - Using Combine
-
- [Optional] If your variable is Numeric, right-click on the variable in the Sources Menu > Duplicate to create a copy of the variable. Change the Structure to Nominal (or Ordinal) in the object inspector > General > Structure.
- Select all of the categories you want to band together (using Ctrl or Shift), right-click and select Combine to merge them into a single category.
- To give the banding a correct label, right-click on the row header > Rename.
CAUTION:
A drawback to using this method is that if you update your data file with fresh data (e.g., more respondents), you may end up with a category not in a band. For example, if you band 1,2,3,4,6,7,9, and 10 into a band "1-10" using the drag-and-drop method and then update your data file, you may have new cases that provide a 5 or 8 score. These new values have not been included in the "1-10" band, and you’ll have to manually merge them in (by repeating the process above). Use the R or JavaScript banding methods linked below to get around this.
Next
How to Band Numeric Variables Using R
How to Band Numeric Variables Using JavaScript