Code Lists
Page in progress
This page is currently under construction.
Key Considerations
- A Code list is re-usable, but only if the categories and code values match exactly. So ‘1-Yes, 2-No’ is different to ‘1-Yes, 0-No’. Likewise 1-Yes, 2-No is different to 1-yes, 2-no.
- Code lists used to input X and Y axis labels in grids are not response domains.
- Code values within a code list must be unique.
Code lists are used for two purposes when documenting a questionnaire:
- To create a response domain answer when a question asks the respondent to choose from a defined list of responses
- To create row and column labels required for a question grid
For both question answers and grid axis labels, the code list generally consists of multiple categories, each of which is assigned a unique code value. A category is a single answer option within a set of multiple-choice options. Occasionally a code list may consist of a single code value and single category. (Add single category examples) [Link] Code list categories can be just a number. (Add just number Y axis example) A code list can also contain a mix of numbers and text categories.(Add scale example)
Code lists used as an answer to a question are response domains. The Response Domain box on the input page must be ticked when creating the code list in order for the code list to be available as an answer when creating a question item or question grid.
Code lists used to create row and column labels for grids are not response domains. Do not tick the response domain box when creating these types of code lists.
Code lists are reusable, therefore when a questionnaire contains multiple questions with the same response choices, or grids with the same row and column labels, only one code list is created and is used repeatedly as a response domain or axis label where appropriate.
Note: For a code list to be reusable, both the code values and category texts must match exactly, including capitalisation and punctuation. So the question responses of ‘1 Yes, 2 No’; ‘1 Yes, 0 No’; and ‘1 yes, 2 no’ are all different and require separate code list response domains.
Code list label construction
Code list labels start with the prefix cs_. The question reference portion of the label is not collapsed.
Code lists that are answers for a single question refer to the question number in their label. A ‘q’ is added before the start of the question reference portion of the label. So the code list label for question ‘A3 a’ would be cs_qA3_a.
The labels for code lists that are answers for multiple questions refer to the categories that make up the code list. The label is made up of the initials of the words in each category with an underscore separating the categories in the code list. So for a multiple use code list consisting of the categories ‘All of the time, Some of the time, Hardly ever, Never’ the code list label would be cs_Aott_Sott_He_N. When code list categories contain punctuation, this is not added to the label.
For example, qc_30 in the USoc COVID-19 Youth Survey Wave 6 questionnaire uses a repeated code list. Although categories 1, 2 and 3 contain the symbol “/”, this is not added to the label. Thus, this code list label would be cs_MF_Gm_BS_Aar_Aawinar_Acr_Acwinar. Other examples of punctuation and symbols that would not be included are “-“ and “!”.
Example 1 Questionnaire: USoc COVID-19 Youth Survey Wave 6
Questionnaire layout:
Archivist Build / Code lists view:
Archivist view (nc_covid_yq6):
Note: Exceptionally to the protocol above, the categories of ‘yes’ and ‘no’ are always spelled out when they are contained in a multiple use code list. So for a code list containing ‘Yes, No, Don’t know’ the label would be cs_Yes_No_Dk’.
Code lists for labelling the X (column) and Y (row) axes in grids usually contain a reference to the grid axis the code list creates. For example, for grid question A4 (qc_A4), the label for the Y axis code list would be cs_qA4_Y, and the label for the X axis code list would be cs_qA4_X. The code list labelled cs_dash (containing the single category of '-') is used as the X axis code list for all grids with a single column with no heading label (see Question Grids for more details). When a grid has a corner label, the code list label for either the X or Y axis is the corner label text with the cs_ prefix (see Question Grids for more details). See How to Construct a label for further guidance.
Assigning code values
If a question response contains code values for the categories, these values are used in the code list. The code value may be a letter, number, roman numeral or symbol (*) and the values may or may not be sequential. Code values within a code list must be unique. (Add symbol and non-sequential examples)
If a question does not contain code values for the response domain categories, a numeric code value is entered sequentially for the categories, starting with ‘1’.
Code values for categories that are just a number mirror the number. (reference examples again?)
Code lists for labels for ‘X’ and ‘Y’ axes in grids also require code values. These are assigned sequentially, and are always numeric (starting with ‘1’), even if there are letter designations in the questionnaire for the row or column labels.
Cardinality
In addition to code list categories and their code values, cardinality must be added when creating a code list.
Scales
There are two types of scale response domain which can be found in questionnaires, those which have discrete points which the respondent can select, and those which are a line which the respondent marks. The former are entered as a code list, the latter are yet to be entered into Archivist. Example 1 below shows a question where a code list is used as the response domain to represent the scale.
Example 2 Questionnaire: NCDS What do you think 1991
Questionnaire layout:
Archivist Build / Code lists view:
Archivist view (ncds_91_wdyt):
Concatenating categories
Sometimes it is necessary to concatenate code list category text into one category. This could be because extra information is provided along the side of the code list, e.g. Example 2, or it could be because there are headings to the categories, e.g. Example 3. Example 2 has additional text to the side of the code list which applies to certain categories. If this was added as a statement then it would not be clear which categories this text applies to, therefore the text is added the code list categories. The order of this concatenation is dependent on the position of the text next to the categories, in this case the text is positioned before the categories and so it is added before. A colon is added in between to denote the two levels. Example 3 below has code list categories which are divided up by headings which apply to some of the categories, again these must be concatenated to the category with a colon to denote the levels.
Example 3 Questionnaire: NCDS Interview 1981
Questionnaire layout:
Archivist view (ncds_8_i):
Example 4 Questionnaire: USoc Youth Self-Completion 2009
Questionnaire layout:
Archivist view (us1_ysc):
Multiple code lists
There are some questions that require more than one code list. This is identified by the change in code values.