SPSS Tips & Tricks #10 – Recode

 In Tips & Tricks

In my last blog post (31/8) I showed you that you can use Exact test if you have too small or skewed dataset and is not allowed to use the original chi-Square test (chi2-test). See below situation, where you can see the test results from original chi-Square test and the problem written in red text:

The reason why the rules for chi-suqare is not fulfilled, is probably because I have very few cases among Team leader, Econom and Seller.

So I would like to recode all these 5 codes into 3 groups, where I put Team leader, Econom and Seller into one group with the code 3.

Before doing the codes write down which codes the old/original variable has (see blog post #9 last Monday about get information in the data window).  Here I have this codings:

I will keep the codes for 1 and 2, but put 3,4 and 5 into the code 3.

Choose the command: Transform – Recode into different variable

Here is the next steps to do:

Then you come into the coding dialog box:

Then copy the other codes (in this case only code 1 and 2).

Finally click “Continue” and then “OK”

Double check that the codings is correct by doing a crosstable between the old and new variable:

Then if I do the first crosstable with Chi-Square test again, but with the new grouped job category variable, I will get this crosstable… :

…and I got this result from the test, that is OK to show (see below). Just a note that I loose some information as I put in 3 categories into one, so this solution to do recoding is not always the best method. In such case I recommend Exact test instead

If you are interested to learn more of the basics in SPSS Statistics functions like recoding and other , there will be a web training available soon. Talk to your contact at CSCS or Crayon, so you can get more information about this web training, that includes both lessons and practices for beginners.

Thanks for watching!  /Gunilla Rudander

error: Content is protected !!