You are on page 1of 7

1

How to Recode and Compute Values including Missing Values (Part 1) (DR SEE KIN HAI)
1. Sometimes in doing research, you need to combine different variables or to alter the values of a variable to suit your analysis. 2. RECODE and COMPUTE can easily do the job for you and can also deal with the Missing values found in the data before [Recode]. 3. As SPSS 20 can easily [Recode] or [Compute] all your values while keeping all your original data intact, so you can enter as many data items as possible in their original form. 4. Use [Recode] and [Compute] variables for H, M and L ranges of scores, to reverse the scoring for negative items and to put together few categories of nominal variable. Practice 1 The Table below shows the Science and Mathematics scores of 10 children from a Primary school. Science marks Mathematics marks Sex Age 29 82 1 10 68 38 1 9 47 91 2 12 50 78 1 8 79 29 2 11 78 38 2 13 29 92 2 7 38 84 1 10 56 67 2 9 47 78 1 11 _______________________________________________________________ Example 1 Compute the correlation between the Science and Mathematics scores for the younger and older pupils from this Primary school. (This is an example for [Recode] only} Step 1: You decide to divide the Age into 2 groups. Younger pupils = less than 10 years old, and Older pupils = 10 and above. FIG 1 Step 2: Enter the data into SPSS 20.

1=Boy, 2= Girl

Step 3: Select [Transform] from the menu bar then [Recode into Different Variables..] Move [Age] into [Numeric Variable..] box then type [AgeRec] into [Name] box. Step 4: Click on [Change] to add this new variable from [Age] to [AgeRec]

Now click on [Old and New Values] to open the dialogue box below.

3 Step 5: Select [Range] and type [9] into [Lowest through value] box. Under [New Value] box enter [1] into [Value] box .

After you have selected [Add] the screen will be as follow.

Repeat for Older pupils. Select [Range, value through HIGHEST] and enter 10 into the box. Type [2] into [New Value] box then [Add] then [Continue] and [OK] in the previous screen that reappears.

4 Step 6: Now you new variable is shown in the [Data View]

To compute the Correlations for Mathematics and Science scores between the Younger and Older Pupils (Just an example to show Recode) 1. Select [Analyze] then [Correlate] then [Bivariate] 2. Move [Mathematics], [Science] and [AgeRec] into the [Variables] box, select [Pearson], [twotailed] then [OK] (Refer to Lecture Note on Correlation)

Correlation between Science and Older and younger Pupils = 0.064 with P = 0.861 which is statistically not significant at p < 0.05 level. Similarly for Maths the correlation between Maths and the Pupils = - 0.038 with p = 0.917 (2-tailed) is statistically not significant

5 Reporting the Output There is no statistical significant correlation between the younger and older pupils in the mathematics and science scores at p = 0.05 level.

How to deal with Missing values in the original data when recoding

FIG 2

Missing values you have defined them

In [Data View] go to [Transform] then [Recode into Different variables..] . Now click on [Old and New Values] (Repeat Step 5)

Step 7: Now select [System- or user-missing] in the [Old Value] box and [System-missing] in the [New Value ] box then [ADD] then [Continue] and [OK].

7 Now you look at your [Data View].

Missing Value is not counted

COURSEWORK 1. Using data from Fig 2 recode Mathematics and Science Scores as follows and label them in your [Variable View] Lowest to 40 = 1 (Low achiever) 41 to 69 = 2 (Average achiever) 70 to highest = 3 (High achiever) 2. Recode the missing values in Fig 2 using Step 7.

You might also like