Professional > Interview scripting > Writing interview scripts > Keywords for data analysis > Combining categorical responses in analyses
 
Combining categorical responses in analyses
You can create additional elements for analyses by combining interviewing responses so that they are displayed as a single row or column in tables. A typical example of this is where you want to create a "top two" or "bottom two" element that combines the counts for the first or last two ratings in a scale. In questions with multiple choice response lists, the combined element will count each eligible respondent once only regardless of how many of the named responses he or she chooses. Elements of this type are called nets because they contain net counts of respondents.
Using an axis block
Define the combined element as follows. You may make it an additional element in tables or you can make it a replacement for the response elements it merges.
Name 'Text' combine({RespName, ... RespNameN}),
where
Name is the name of the new element.
Text is the text you want to display for this element in analyses.
RespName to RespNameN are the names of the responses to be combined to form the new element.
Example
RateAOverall "How would you rate Product A overall?" categorical [1..1]
{
Excellent,
VGood "Very good",
Satisfactory,
Poor,
VPoor "Very poor"
}
axis (
"{
Top2A 'Excellent/Very Good' combine({Excellent, VGood}),
Excellent, VGood, Satisfactory, Poor, VPoor,
Bottom2A 'Poor/Very Poor' combine({Poor, VPoor})
}"
);
Using an Analysis element
Place the following statement in the appropriate position in the list of interview responses:
Name "Text" elementtype(AnalysisCategory) expression("QName * {RespName1, ..., RespNameN}")
where
Name is the name of the new element.
Text is the text you want to display for this element in analyses.
QName is the question name.
RespName to RespNameN are the names of the responses to be combined to form the new element.
Example
Here’s a variation of the previous question written using analysis elements:
RateBOverall "How would you rate Product B overall?"
categorical [1..1]
{
Top2B "Excellent/Very Good" elementtype(AnalysisCategory)
expression("RateBOverall * {Excellent, VGood}"),
Excellent, VGood "Very good",
Satisfactory,
Poor, VPoor "Very poor",
Bottom2B "Poor/Very Poor" elementtype(AnalysisCategory)
expression("RateBOverall * Poor, VPoor}")};
See also
Keywords for data analysis