Title: Some practice of recoding
Course: UGQuants (SSPS) > Section: Univariate Analysis

Some practice of recoding

Below are some recodes to perform from the European Social Survey, 20010. After each recode make sure you label the new values and define any missing values. Finally, produce a frequency table for the new variable. Like other aspects of data manipulation and analysis, you will become more proficient at thinking about and performing recodes if you practice.

1) Recode the variable ‘agea’ (age of respondent) into 5 groups:
1 = 34 and younger
2 = 35-49
3 = 50-64
4 = 65 and older
5 = Data not available

2)  Recode the variable ‘wkhtot’ (total hours normally worked per week in main job) into 4 groups:
1 = Less than 35 hours
2 = 36-40 hours
3 = More than 40 hours
4 = Not applicable, refusal, don’t know and no answer

3) Recode the variable ‘prtvtgb’ (party voted for in last national election, United Kingdom) into 2 groups. Note that, provided value 9 in the new variable is defined as missing, we could now use this as a dummy variable (where we always code the category of interest as 1 and all other valid categories as 0):
1 = Conservative
0 = All other parties
9 = Not applicable, refusal, don’t know and no answer