Desktop User Guides > Professional > Data management scripting > Creating new variables > Example 4: Creating “Total Awareness” variables
 
Example 4: Creating “Total Awareness” variables
Market research surveys frequently ask respondents to:
Name their favorite brand of a product (such as washing powder).
Name any other brands of the product they can remember.
Look at a list of brands of the product and say which ones they have heard of or used before.
Typically the category lists for each of these questions are identical. The first of these questions is typically a single response question, the second question (known as a spontaneous awareness question) and the third question (known as a prompted awareness question) are typically multiple response questions.
It often useful to create a “total awareness” variable that combines the responses to the three questions for use during analysis.
The Museum survey does not contain questions of exactly this type. However, it has a single response question called Interest, which asks respondents to say which gallery they found most interesting and a multiple response question called Remember, which asks respondents to select all of the galleries they remember viewing. Both questions have identical category lists and we will use them in the following example to illustrate how to set up a total awareness variable.
The example shows setting up a total awareness type of categorical variable in the Metadata Section. The variable is created as a derived categorical variable using a single expression that uses the Union function in the UNICOM Intelligence Function Library to combine the two categorical variables. No categories are specified. This means that the categories will be generated automatically based on the categories in the variables in the expression. In addition, the Union function will generate categories even if the value of Remember or Interest is NULL (which means that the question was not asked).
Metadata(ENU, Question, Label, myInputDataSource)
TotalAwareness "Most interesting gallery and all galleries remembered"
categorical [..]
expression ("Union (remember, interest)");
End Metadata
The category lists in the variables you are combining do not have to be identical. You can create a derived variable that is the combination of two or more categorical variables that have different or overlapping category lists.
The example in this topic is in the NewVariables.dms sample DMS file. For more information, see Sample DMS files.
Requirements
UNICOM Intelligence Professional
See
Creating new variables