Creating a new variable containing multiple codes
A multiple code variable is constructed by selecting individual codes from existing variables and combining them to form a new, complex variable. The process involves:
Selecting the variables that contain the codes you wish to use;
Selecting the appropriate codes from those variables, and
Defining how those codes are to be combined to create the new variable.
This is all done within the multiple code variable construction screen.
For example you may wish to create a variable that uses wider age bands than is contained in the existing variable. You would do this by taking the existing Age variable and combining some of the codes into a smaller number of codes.
Open the multiple code variable construction dialogue box
Click on the multiple code construction icon on the tool bar
Select Variables|Create new variables |….Containing Multiple code
Or use the short cut key: Ctrl+M
Your will see:
The variable construction window
The window used for constructing multiple code variables has four main areas:
Variable titles list
This displays the index of all the variables in the project database, including any user-defined variables you may have added earlier.
This displays the codes of any variable that has been selected and from which the codes of the new variable will be constructed.
This is used to define the way the codes for the new variable are combined.
New variable list
This displays the definition of the new codes and the name you have assigned to the variable.
Create the variable
From the Variable titles list, select the first of the variables that contains codes that you wish to use in the construction of the new code. The codes of this variable will now appear in the Variable codes area.
Select the codes that you wish to work with by highlighting them in the Variable codes area. To select more than one code at a time hold the Ctrl key down as you select them. To select a range, click the first code then holding the Shift key down, select the last.
You now have four options in using the selected codes to define the new code: you can simply Add them to the Construction Area, Merge them with codes you previously added to the Construction Area, Net/Roll selected codes, or use the code to create a Condition which the new code must satisfy. The effect of each of these is as follows:
Adds the selected codes to the Construction Area to form codes of the new variable
Nets the selected codes into one new code and adds this to the Construction Area to form a code of the new variable. If the codes define a time-line, you will be given the option to "roll" codes together to form a "moving average".
Merges selected codes with those already in the Construction Area on a one-to-one basis. The number of selected codes must equal the number of codes already in the Construction Area.
If, for example, if you had a list of companies people had press advertising awareness of, you could add this to the Construction area, then Merge these with a list of companies people had television advertising awareness of. The resulting variable would then contain the combination of the two.
The selected code (single code only) will be used to define a condition (or filter) for the codes listed in the Construction Area. You can then use the drop-down combo box to select the Logical Operator (OR, AND, or NOT) you require.
If the code you use to define a condition is a numeric value (e.g. actual age), you will need to specify the range that this variable needs to meet to satisfy the condition.
Use the pull down menu to specify which operator (i.e. greater than, equal to etc) you wish to use.
When you are satisfied that the Construction area correctly defines the codes you wish to make up the new variable, either click on the Add button to the right of this area or the Not button if you have defined the respondents you don't want in the new variable. The code definitions will then appear in the New variable area.
You can repeat the above, adding more codes to your new variable using different conditions until you have defined all the new codes that you require.
If you make a mistake while constructing your codes, use the Clear button to the right of the Construction area to start again.
If you have added a code to the New Variable list and then changed your mind, use the Delete button to the right.
Enter a title for the new variable by selecting Title in the uppermost box of the New variable area and over typing your selected label.
If you are satisfied with the definitions and the title of the new variable, click on the Write code button in the top right hand corner of the screen
The new code will now be written and added to the project file. The new variable will appear in the variable index at the bottom of the index in a new folder titled User-defined variables.
Having created the variable you may wish to edit the names of the codes to produce more user-friendly alternatives. This can be done by running a table using the variable and editing the labels by double-clicking on them.
See also: Deleting variables, Creating Variables, and Editing text elements