Title: 6. From words to numbers: data coding
Course: UGQuants (SSPS) > Section: Survey Design

From words to numbers: data coding

In order to undertake quantitative analysis of the data we have collected, we must first translate our survey responses from words to numbers. This process is known as coding and is an important stage in survey research.

There are two key stages to coding. Firstly, we need to categorise the data. Careful consideration must be given as to how we choose to categorise our data, as these choices will impact upon our analysis and results, as we have mentioned when discussing the response structure of closed questions. Secondly, we need to assign numbers to our selected categories. It is important to note that the numbers are simply labels that we assign to our categories to allow us to undertake quantitative analysis of our data. There are a number of basic principles that should be followed when coding our data which we will now consider.

There are two broad types of coding known as pre-coding and post-coding. Pre-coding occurs before the survey is administered and is often used with closed questions.  In such questions, respondents are provided with a set of fixed responses and codes are allocated to each of these response categories. In many cases where the survey is administered in paper form, these codes are visible making the later process of data entry easier. In the case of surveys administered electronically, the codes can be programmed beforehand allowing for automatic coding of responses.

A simple example of a pre-coded question (from before the Marriage (Same Sex Couples) Act 2013) would be:

What is your current marital status? Please tick ONE option.

1 Married [    ]

2 In same sex civil partnership [    ]

3 Living with a partner [    ]

4 Separated (after being married or in a civil partnership) [    ]

5 Divorced/dissolved civil partnership [    ]

6 Widowed/surviving partner from a civil partnership [    ]

7 Single (never married/never in a civil partnership) [    ]

8 Other [    ]

In this question the marital status ‘married’ takes the code 1, the marital status ‘in same sex civil partnership’ takes the code 2 and so on.

Post-coding, on the other hand, involves coding the data after it has been collected and is generally used with open questions. Where appropriate, responses to open questions can be coded using pre-existing coding schemes, otherwise they require the researcher to develop a coding scheme based on the responses given. In the latter circumstances, the researcher will often examine an initial sub-sample of responses with the aim of identifying broad themes across responses. Having identified broad themes, the researcher will identify specific answers within a theme which are given individual codes. It is important to note that when coding responses to open questions, responses need to be similar but not identical to receive the same code. How similar they need to be depends on the level of detail we wish to code to. The greater the level of detail in our coding scheme, the more similar responses ought to be in order to be assigned the same code. Following, we will discuss how response categories are formed.