How do I record what every number means? (codebook, value labels, missing codes)
In brief
A file contains numbers. What they mean is in the codebook: for every column the name, a label, the answer values with value labels (“4 = rather satisfied”), the missing codes and the level of measurement. Without a codebook it is unclear whether a 4 means “very satisfied” or “dissatisfied” and whether a value such as -9 may be counted. Missing codes appear in the data but later do not count as a valid answer. The statements of this article describe how Statable works with codebooks; no literature source was read for them.
Do it yourself
The short questionnaire is invented (no real codebook). For every question fill in the columns “name”, “values with labels”, “missing codes” and “level”. Names begin with a letter and have no umlauts. For “don’t know”, “no answer” and “not shown because of a filter” the codes -8, -9 and -7 are usual. Only then read the solution.
| Question (invented) | Answers | Name, values, missing, level |
|---|---|---|
| How old are you? | number in years; “no answer” possible | ? |
| Do you eat in the canteen? | yes or no | ? |
| On how many days a week? (only if “Yes”) | 1 to 5 | ? |
| How satisfied are you with the food? (only if “Yes”) | very dissatisfied to very satisfied, “don’t know” | ? |
Solution
| Name | Values with labels | Missing | Level |
|---|---|---|---|
| alter | number in years | -9 = keine Angabe | scale |
| mensa | 1 = Yes, 2 = No | -9 | nominal |
| mensa_tage | 1 to 5 days | -7 = not shown because of filter, -9 | scale |
| mensa_zufr | 1 = very dissatisfied, 2 = rather dissatisfied, 3 = neither, 4 = rather satisfied, 5 = very satisfied | -7, -8 = don’t know, -9 | ordinal |
Other names are possible. What matters are the reasons: satisfaction is ordinal, because the order is clear but the distances are not. Questions 3 and 4 have -7 because they are not shown when the answer is “No”. If the scale contained a reverse-worded question, the reversal would belong in the codebook.
Missing codes
A missing code appears as a number in the column. If it is not declared as missing, a program counts it as a value: a mean over numbers from 1 to 5 and several -9 would be too low. In the codebook the codes are therefore declared as missing. The three codes mean different things: -8 uncertainty, -9 no answer, -7 not shown at all. In the analysis they can therefore be treated differently.
How it works in Statable
- In “Plan a questionnaire” (#fragebogen) the view “Codebook” shows a table: name, label, values, missing, level and origin. You change name and label here; this affects the questionnaire. A name begins with a letter, consists of letters, digits and underscore, has no umlauts and at most 32 characters.
- From the plan Statable produces the codebook as a Word file and the PSPP syntax with variable labels, value labels and missing values. The exports are blocked as long as errors stand in the plan check.
Not true - this is how it is
Sources
Help articles “Plan a questionnaire” and “Data check”. No published source on codebooks was read for this article; the examples are invented. For practice with a real codebook, open data sets from data archives are suitable.
Take away
- The codebook says for every column what its numbers mean: name, label, values, missing codes and level.
- Missing codes stand in the data and must be declared as missing, otherwise they get counted.
- “Not shown because of a filter”, “don’t know” and “no answer” mean different things and get codes of their own.
- Statable produces the codebook from the questionnaire plan; name and label are changed in the codebook view.