When categories are merged by dragging and dropping on a table, the new categories do not appear when the variable is selected to create a weight. For example, if you have age collected as a Numeric variable, but turned it into a Nominal variable and merged all its categories, the original pre-merged categories will appear when you select this variable as an Adjustment variable in a Weight. This is to ensure that if people merge categories or make overlapping categories, the weights in their project are not inadvertently changed. There are various ways of going about this depending on your preference with Methods 1 and 2 being the easiest:
- Method 1 - Drag and drop categories to group them in the weighting dialog
- Method 2 - Use the Combined Categories for Weighting automation
- Method 3 - Create an R variable that keeps the changes made in the table of that variable
- Method 4 - Use a method for merging the categories which change the underlying values
Method 1 - Drag and drop categories to group them in the weighting dialog
If you don't need the combined categories in your tables, you can combine them within the weighting dialog itself.
1. Hovering between any variables in your Data Sources tree and click Plus (+) > Weight.
2. Select your adjustment variable.
3. Select the category label in the weighting table that you want to combine and drag it onto the appropriate category label. Here, for example, I have dragged 25 to 34 onto 18 to 24 to effectively create 18 to 34:
Method 2 - Use the Combined Categories for Weighting automation
If it's easier to combine categories on the table directly or you've already combined them on a table, you can simply save a copy of the variable with the combined categories via an automation.
1. In the Data Sources tree, select the variable with the combined categories.
2. Hover and select Plus (+) > Combine Categories > Categories in NETs (formerly labeled as Combined Categories for Weighting).
3. A new variable will appear with the combined categories as the values and you can use this variable as an adjustment variable in your weight.
Method 3 - Create an R variable that keeps the changes made in the table of that variable
1. Combine the categories in the table of the variable in question, e.g., 18 to 24 and 25 to 34 as 18 to 34:
2. Select the modified variable in the Data Sources tree.
3. Hover and click Plus (+) > Custom Code > R > Numeric.
5. Either select or drag the variable from the Data Sources tree to the R Code editor field in order to populate the variable name. Otherwise directly enter or paste the variable name there.
6. Change Structure to Nominal.
7. Update Name and Label.
8. Create your weight as usual, but select the new variable and it will retain the modified categories:
Method 4 - Use a method for merging the categories which change the underlying values
See How To Band Numeric Variables Using JavaScript or How to Band Numeric Variables Using R).