Professional > Interview scripting > Writing interview scripts > Questions and responses > Questions with categorical responses > Defining categorical response lists
 
Defining categorical response lists
To define a question with a predefined set of possible responses, place the following statement in the metadata section of the interview script:
Syntax
Qname "Text" categorical [[NumChoices]]
{ ResponseName1 ["ResponseText1"],
  ...
  ResponseNamen ["ResponseTextn"]
};
Parameters
Qname
The question name.
Text
The question text.
NumChoices
A single number or a range specifying the number of responses that may be chosen from the list. If you omit this parameter, respondents may leave the question unanswered.
ResponseName1 to ResponseNamen
The names of the responses from which the choices may be made.
ResponseText1 to ResponseTextn
The response texts.
A categorical response list may contain any number of responses (approximately 4 billion is the theoretical maximum). Respondents may select any number of responses and all the chosen responses will be written to the case data, and will be correctly processed by UNICOM Intelligence Reporter - Survey Tabulation. However, the SPSS MR OLE DB provider (mrOleDB.2) is only able to return the first 200 categories, so if you have an application that accesses the data using this provider you may lose data if respondents have chosen more than 200 responses for a question.
Response names and response texts
As the syntax statement shows, each response has a name and a response text. The response text (referred to as the label in some documentation) is the full text of the response as you want it to appear during the interview or on a printed questionnaire. It may contain any combination of letters, numbers, punctuation, and other characters. Depending on the response’s name, you may be able to omit the response text from the definition and display the response name instead.
The response name is a single word that is used by the interviewing program and other SPSS applications for identifying the response. It must start with a letter or underscore (_) character. The rest of the name may contain letters, numbers, or the underscore (_) character. If the response text is a single word that satisfies the criteria for a response name, you can define just a response name and the interviewing program and the printed questionnaire will display this as the response text.
Here is an example of a question with a single-choice response list. The question text has been split across two lines for display purposes only. When you type question texts you should type them all on one line with no line breaks:
LastEatOut "And the last time you ate out
  what type of restaurant did you go to?" categorical [1..1]
{
  Indian,   
  Chinese,
  Greek,  
  Italian,  
  English,  
  WestIndian "West Indian",  
  French,
  Thai,
  Japanese,  
  Spanish,
  Turkish,
  Other
};
There are several things to notice about this example:
The West Indian response has a response name and a response text because the text you want to display consists of two words. None of the other responses contains spaces or any other special characters so you need only specify the response name.
Each response is shown on a separate line. This is the standard way that UNICOM Intelligence Professional displays interview scripts. You can type more than one response on a line and, in some instances, the documentation shows response lists in this format if this allows a complete example to displayed on one page. However, when you close and reopen an interview script, response lists will always be shown as in this example.
This example contains a simple Other response that respondents who went to a different type of restaurant can select. It is not a special Other Specify response that automatically prompts the user to enter an associated text response. For details about Other Specify responses, see Other Specify.
The [1..1] identifies this as a single-choice response list. This means that the responses will be displayed with radio buttons during the interview and respondents will be able to select only one answer from the list. If you omit this parameter respondents may leave the question unanswered. You can abbreviate the number of responses required for single-choice response lists to [1], but when you close and reopen the file, this will be converted to [1..1].
Here is another example that illustrates a situation when you must always define response names and response texts. Most of the response texts you want to display start with a number. Response names cannot start with numbers so you must choose different names for each response:
ChildAge "How old are your children?" categorical [1..]
{
YUnder1 "Under 1 Year",
Y3_5 "3-5 Years",
Y6_12 "6-12 Years",
Y13_16 "13-16 Years",
Y17_18 "17-18 Years",
Y19_21 "19-21 Years",
YAdult "Over 21 Years"
};
Note If you need to use a double quotation mark in a question or response text, you must type it as " so that it is not interpreted as a quotation mark that encloses text.
How many responses can be chosen?
When the respondent must choose a fixed number of responses, type that number enclosed in square brackets. The interviewing program will not allow respondents to move to the next question unless they have chosen the specified number of responses. For example:
KeyPoints "From the following list
  what are the <b>two</b> main points
you consider when choosing a restaurant for a family celebration?"
categorical [2..2]
{
  Price, Location,
  ChildrenWelcome "Children are welcome",
  ChildMenu "Children's menus",
  FoodChoice "Wide choice of dishes",
  Vegetarian "Vegetarian options available on the main menu",
  SpecialDiet "Special diets catered for",
  Ambience "General feeling and ambience",
  NoSmoke "Non-smoking",
  AllowsSmoking "Smoking allowed"
};
If you do not specify the number of responses required, the interviewing program allows respondents to leave the question unanswered.
The usual method of setting up a multiple-choice response list is to specify the number of responses as [1..], meaning that one or more responses may be chosen. For example:
FoodLiked "What types of food do you like?" categorical [1..]
{
Indian, Chinese, Greek, Italian,
English, WestIndian "West Indian",
French, Thai, Japanese, Spanish,
Turkish, Other
};
You can specify the maximum number of responses that can be chosen from a multiple choice list by typing, for example:
UsuallyCook "When you cook for friends, which types of food do you
usually cook? You may make up to three choices." categorical [..3]
{
Indian, Chinese, Greek, Italian, English,
WestIndian "West Indian",
French, Thai, Japanese, Spanish, Turkish,
Other
};
Because there is no minimum number of responses defined, respondents may leave this question unanswered. If you want respondents to answer the question you must specify a minimum number of choices, so most questions of this type would specify a range such as [1..3].
See also
Questions with categorical responses