Coding, data entry and computation
Coding turns each answer into a number using a codebook. The numbers are entered into a computer, checked, and used to compute totals, percentages and means.
From filled forms to results
Kothari lists the processing steps as editing, coding, classification and tabulation. Data entry and cleaning are added when a computer is used. Ranjit Kumar's coding steps: develop a codebook, pre-test it, code the data, verify the coding.
A small codebook (breakfast survey of college students)
| Column | Variable | Question | Codes |
|---|---|---|---|
| 1 | ID | Respondent number | 001-120, as written on the form |
| 2 | YEAR | Year of study | 1 = I year, 2 = II year, 3 = III year, 9 = no answer |
| 3 | SKIP | Do you skip breakfast? | 1 = yes, 0 = no, 9 = no answer |
| 4 | DIET | Diet type | 1 = vegetarian, 2 = eggetarian, 3 = non-vegetarian, 9 = no answer |
| 5 | WT | Weight (kg) | Actual value to one decimal; 999 = missing |
| 6 | HT | Height (cm) | Actual value; 999 = missing |
| 7 | REASON | Why do you skip breakfast? (open) | 1 = no time, 2 = no appetite, 3 = dieting, 4 = food not liked, 5 = other, 8 = not applicable, 9 = no answer |
Coding one form and computing BMI
Student 017 is in II year, skips breakfast because she has no time, is vegetarian, weighs 52.5 kg and is 158 cm tall. Code her form with the codebook above and compute her BMI.
- ID = 017
- YEAR: II year → 2
- SKIP: yes → 1
- DIET: vegetarian → 1
- WT = 52.5; HT = 158
- REASON: 'no time' → 1
- Data row: 017 | 2 | 1 | 1 | 52.5 | 158 | 1
- BMI = weight (kg) ÷ height (m)² = 52.5 ÷ (1.58 × 1.58) = 52.5 ÷ 2.4964 = 21.0 kg/m²
Row 017, 2, 1, 1, 52.5, 158, 1. BMI 21.0 kg/m²: normal by the Asian Indian cut-off (18.5-22.9).
Rules for good coding and entry
- Categories must be exhaustive (every answer fits somewhere) and mutually exclusive (each answer fits only one place).
- Each category should cover one idea only.
- Pre-code closed questions while designing the form; post-code open answers after reading a sample of them.
- Give a fixed code for missing or 'not applicable' answers, such as 9 or 999.
- Enter one row per respondent and one column per variable.
- Run a frequency count to catch impossible values (YEAR = 5), and re-check a sample of forms or enter the data twice.
In diet surveys, computation is a big step. Each food in a 24-hour recall is converted to nutrients using the Indian Food Composition Tables (IFCT 2017), then compared with the ICMR-NIN RDA to find the percentage of adequacy.
2 marks: “What is coding of data?” Coding is assigning numbers or symbols to answers so that they can be grouped into categories, entered into a computer and counted.
5 marks: “What is a codebook? Explain with an example.” A codebook lists each variable, its column, the question and the code for every answer, including missing values. Show four or five rows from a diet survey.
10 marks: “Explain the steps in processing data: editing, coding, data entry and computation, with an example.” Flow chart of processing; editing; coding rules and a small codebook; data entry and cleaning; computing BMI or nutrient intake; then tabulation.
"Every Coder Enters Clean, Correct Tables" = Editing, Coding, Entry, Cleaning, Computation, Tabulation.