This article describes how to combine two or more variables with the same structure into a single variable set displaying data for each on the same table.
- Familiarity with the Structure and Value Attributes of Variable Sets.
- Two or more variables with the same structure that you want to combine into a single variable set.
- Variables' Value Attributes (codes) must be consistent across the variables, that is the Value for each category must be the same. If not, please see Additional details.
1. From the Data Sets tree, select the individual variables that you want to combine by holding down your Ctrl key and selecting each variable. In this example, we've selected a series of brand attitude questions each setup as Nominal: Mutually exclusive categories and each containing the same preference scale.
2. From the toolbar menu, select Combine > As Variable Set > Do Not Merge Variables. If you've already used any of the variables to create tables/outputs in your document, you'll be to choose one of the following options:
- Change data in all tables and charts - updates existing tables and charts based on new variable structure.
- Make a copy so existing tables and charts are not affected - which creates a copy of the variables which leaves existing tables and charts unchanged.
A new combined variable set is created. Displayr will automatically work out the appropriate variable set structure based on the input variables. In the example, above, since we using nominal variables as inputs, Displayr creates a variable set with the structure Nominal - Multi: Grid with unordered categories.
3. OPTIONAL: To rename, right-click on the variable set name (q4 in the above example) and select Rename.
When combining categorical variables together in a set, the categories in the final set are labeled based on the values of the categories across all the variables. If you your variables don't have consistent values across them, you will need to recode them to be the same. For example, if one of the brands above had the reverse values for the scale, you would need to change the values to be consistent with the other brands. To do so:
- In the Data Sets tree, select the variable to recode.
- In the object inspector, click Value or Select categories to pull up the Value Attributes.
- Change the Value column to what value should correspond to the category in the final set and click OK.
- Repeat this recode process for all variables until they are consistent.
- Change the Label of the variable to correspond.
- Select all the variables with the consistent codes in the Data Sets tree.
- From the toolbar menu, select Combine > As Variable Set > Do Not Merge Variables.
- You should click on the Values or Select Categories on the final variable set to confirm that the Values and Categories are what you expect and to refine any category labeling.