Sometimes two variables will have been set up so that they have the same Labels, but different Values associated with their labels. For example, Q1 may have 1 Yes and 2 No, while Q2 may have 1 No and 2 Yes. If Combine is used to create a Variable Set using these variables, the labels will be taken from the first of the variables, which will mean that the table provides misleading results (you will get a warning).
Method
The solution to this problem is to:
- Recode the values so that they align. In the example above, this means replacing the Value for No with a 2 and Yes with a 1 for Q2.
- Hover over the variable in Data Sources > Plus (+) > Custom Code > JavaScript - Numeric
- Select the newvariable in Data Sources and give it a descriptive label in General > Label in the Object Inspector.
- In the Data > Javascript Code box, type in the Name of the variable from step 1.
- Repeat steps 2 through 4 for every variable that needs to be copied.
- Select the existing variables that were not recoded, and the copies of the recoded variables and click Combine in the toolbar at the top.
The logic behind this is as follows:
- When you use Combine, Displayr does not look at the actual Values. Instead, it looks at the Source Values (i.e., the values prior to any recoding). This is often useful as it permits Combine to work even when you have recoded data such that multiple Labels share a single Value (e.g., if computing NPS).
- When you create the new JavaScript variable and connect it back to the original variable, that new variable refers back to the Values, not the Source Values of the previous variable. As these values have been changed by the recoding, then the Source Values of the JavaScript variable will now reflect what is required.
Next
How to Recode into Existing or New Variables