SPSS Tips & Tricks #16 – recode string to numbers

 In Tips & Tricks

Next Monday I will show you how easy it is to do an automatic recode of string variables to numeric variables, but you will get the alphabetic order and there were a user who asked for an own order of the recoding. I happens often that you get text answers  from a websurvey, and in some cases it’s ok but if you want to do statistical analysis like correlation it will not work – then you must convert them to numbers.

Here is my data example that is quite common to find when you recieve data from a study. It’s in an Excel file, and when you get it over to SPSS it will automatically be string variables and you are very limited to do statistics on that:

So I will recode these to number codes instead.

Choose the command : Transform – Recode into different variables

You type in new variable names on your new variables, I have typed in att1 and att2.

When you have clicked on the button “Old and New values” you will get this dialog box:

So add all new codings until you are ready:

Then you will see the new variables that is possible to use in factor analysis, correlations, calculation avarage and so on:

I recommend to save this into syntax by also do the command again and klick on the “Paste” button so you can reuse the command.

Thanks for watching!

Gunilla Rudander

error: Content is protected !!