Merging variables

You can merge two or more variables to form a new variable. This is useful when you want to create a total awareness variable or when you want two or more categorical variables to be treated as one variable in your tables.

When merging categorical variables, the new variable will automatically have the same categories as the categorical variables you are merging. If the same category appears in more than one of the variables, it will appear only once in the new variable.

When merging text variables, the new variable will contain the texts from the text variables you are merging, concatenated together.

When merging numeric or date variables, the new variable will contain the sum of the values stored in the variables you are merging.

When merging any variables, the variables that you select:

• must be of the same type (although they can be a mixture of single response and multiple response categorical variables)

• must be at the same level if you are using hierarchical data. The level of the variables you select defines the level of the new variable. For example, if you select variables in the Person loop, the new merged variable will also be at the Person level.

If any of the variables you are merging has been edited, the edits will not be copied to the new variable. For example, suppose you merge two categorical variables from which you have deleted one or two categories. The new variable will include the deleted categories.

When you merge variables that contain any built-in special items, the new variable will not contain any of the built-in special items. You are most likely to see this when you are working with IBM® SPSS® Quanvert™ data, which typically contains built-in special items. For example, if you merge two Quanvert variables, either or both of which contain a built-in mean, the new variable will not contain a mean. Similarly, built-in bases are not copied to the new variable and IBM® SPSS® Data Collection Survey Reporter will therefore insert an autobase into the new variable.

Merging variables

In the Variables pane, use Shift+click or Ctrl+click to select the variables that you want to merge.

From the menu, choose

This displays the New Variable window. Because you are creating a new variable rather than editing an existing variable, the variable has an automatically generated name such as NewVar. The text Based on, followed by the name of the original variable, is displayed on the right of the window.

Select the default name and change it to a meaningful name for your variable. Ensure that the variable name conforms to the Survey Reporter Naming Conventions.

A default description is displayed in a text box beneath the name. You can edit this to give the new variable a meaningful description.

Make any further edits to the variable using the features in the New Variable dialog box.

Choose Save and Close from the toolbar.

You can now use the new variable in your tables.