The purpose of coding is to assist with the analysis of responses to a survey, by enabling the researcher to organise and quantify the data obtained. With a large survey, appreciable gains in time and accuracy can be obtained from coding information in a form which can be entered directly onto a computer, leaving the researcher free to manage and co-ordinate the overall report.
Coding usually takes the form of using numbers to identify particular replies. In some cases, it is possible to allocate codes in advance - for example, with a structured questionnaire where questions and answers have already been prepared - and the codes may even be printed out too (although this can bias replies, if respondents understand, or think they understand, what the codes signify). When the responses are received, all the replies to a particular question are collated under each code.
The coding of answers to closed questions is relatively simple, as the range of possible responses is already known, but open questions pose more difficulties. The aim of coding is to simplify responses by placing them into defined groups, but with open questions, it may not be clear into which category the response should be placed - and hence classification is dependent on the collator's judgement. In addition, fitting the responses to open questions into summative categories can result in valuable, detailed information being lost at an early stage of analysis.
Once the data has been collated, it is usual to carry out consistency checks on the data file before starting analysis. This may involve cross-tabulation of responses to individual questions, as well as checks on the ranges of variables. Analysis should not begin until these checks have been completed and the data file "cleaned" by editing out errors.