Home › Statistics Homework Help › SPSS Help › Recoding Variables in SPSS
Transform your data, keep the original

How do I recode variables in SPSS?

You recode in SPSS with Transform > Recode into Different Variables. Move the variable in, name a new output variable and click Change, then open Old and New Values to map each old code to a new one, click Add for every pair, and press Continue then OK. This route writes to a new column and leaves your raw data intact, which is why it is the safe choice for reverse scoring, binning and collapsing categories.

✓Exact menu path and mapping tables ✓Reverse score, bin and collapse ✓Human statisticians, no AI

What this page covers

Recode into Different VariablesOld and New ValuesReverse scoring Binning with RangeCollapsing categoriesCompute Variable Visual BinningValue labelsCommon mistakes
Since 2014statistics specialists
Any recodeset up and checked
★★★★★rated by students
3 hrsfastest turnaround

Recoding means turning the values of a variable into new values: flipping a reversed scale, grouping ages into brackets, or merging several categories into fewer. SPSS gives you two routes, and the one you pick decides whether your original data survives. This guide is part of our statistics homework help. It gives the exact menu path, the Old-and-New-Values mapping for three real tasks, and the mistakes that quietly break a scale score.

The golden rule. Always choose Recode into Different Variables, never Recode into Same Variables. The "same" route overwrites the original column, so the raw data is gone and a mistake cannot be undone. The "different" route writes the result to a new variable and leaves the original in place, so you can check the recode against the source and rerun it if a rule was wrong.

The menu path, step by step

Every recode below uses the same dialog. Learn this once and the three tasks are only different mappings.

Transform > Recode into Different Variables. Move the variable to recode into the centre box. Under Output Variable, type a Name for the new variable and an optional Label, then click Change so the arrow shows oldnewname. Click Old and New Values. For each rule, enter the Old Value on the left and the New Value on the right and click Add. When every value is mapped, click Continue, then OK.

Two habits save marks. First, give the output variable a name you will recognise later, such as the source name with a suffix like _R for reversed or _grp for grouped. Second, after the recode, open Variable View and add value labels to the new variable, because Recode writes numbers only and the new column has no labels until you add them. Without labels your tables show bare codes instead of the group names.

Inside Old and New Values you also have Range options for continuous data: Range, LOWEST through value, Range, value through HIGHEST, and a Range from one number through another. The All other values option at the bottom lets you send everything you did not list to a single code or to system-missing, which is a clean way to handle leftovers.

Three recoding tasks, worked end to end

The exact Old-and-New-Values mapping for the jobs you actually get set: reverse scoring, binning and collapsing.

1. Reverse-score a negatively worded Likert item

A negatively worded item points the wrong way on the scale. You flip it before you average items or run reliability, or the scale score and Cronbach's alpha come out wrong.

Say a job-satisfaction scale is measured on five points, where one is strongly disagree and five is strongly agree, and the item "I often think about quitting" is negatively worded. A person who is satisfied should score high on the scale, but on this item they answer low, so its direction has to be reversed before it joins the others. For a 5-point item you swap one with five, two with four, and leave three where it is.

Transform > Recode into Different Variables. Move quit_think in, set the Output Variable Name to quit_think_R, click Change, then open Old and New Values and add the five rules below. Continue, then OK.
Old and New Values mapping, 5-point reverse score
Old ValueNew ValueMeaning
15strongly disagree becomes strongly agree
24disagree becomes agree
33neutral stays neutral
42agree becomes disagree
51strongly agree becomes strongly disagree

Worked check. A respondent who scores two on the raw item now scores four on quit_think_R, which lines up with the positively worded items. Run a quick Analyze > Descriptive Statistics > Frequencies on both columns side by side: the counts mirror each other, one against five, two against four. That mirror is the proof the recode worked.

Shortcut with ComputeThe same reversal is one line under Transform > Compute Variable: quit_think_R = 6 - quit_think. The constant is the scale maximum plus one, so a 7-point item uses eight minus the score.

Common mistakes

  • Averaging the scale before reversing the item, so the reversed item pulls the score the wrong way and Cronbach's alpha drops.
  • Using Recode into Same Variables, which overwrites the raw response with no way back.
  • Forgetting the middle value. On a 5-point scale three maps to three, but it still needs its own rule or it can be left blank.

Not sure which items on your scale are reversed? Send the questionnaire and data and a statistician will reverse the right ones and rebuild the scale. Get a quote →

2. Bin a continuous variable into groups

Turns a continuous measure such as age into ordered brackets, for a grouped comparison or a cleaner table.

Here you keep age as a continuous variable and add a grouped copy, so you can still use exact age elsewhere. The trick is the Range controls in Old and New Values. Use LOWEST through for the bottom band and through HIGHEST for the top band so no real value falls outside your rules.

Transform > Recode into Different Variables. Move age in, name the Output Variable age_grp, click Change, open Old and New Values, and enter the four ranges below using the Range radio buttons. Continue, then OK.
Old and New Values mapping, age into four brackets
Old Value (Range)New ValueGroup label to add later
Lowest through 291Under 30
30 through 44230 to 44
45 through 59345 to 59
60 through Highest460 and over

Then label it. In Variable View, click the Values cell for age_grp and add one for Under 30, two for 30 to 44, three for 45 to 59, four for 60 and over. Set the Measure to Ordinal, since the groups have an order. Run Frequencies on age_grp to confirm the counts add up to your sample size, which tells you no case was left unmapped.

AlternativeFor equal-sized or equal-width bands, Transform > Visual Binning can scan the variable, place the cut points for you and write the labels automatically. Recode is better when the boundaries are fixed by your brief.

Common mistakes

  • Off-by-one boundaries. Writing 30 through 44 and then 45 through 59 is clean, but 30 through 45 and 45 through 59 puts anyone aged 45 in two rules, and SPSS applies the first match only.
  • Using fixed numbers at the ends instead of Lowest and Highest, so an unusually young or old case is left blank.
  • Binning away detail you still need. Keep the continuous age as well, since grouping throws information away.

3. Collapse categories into fewer groups

Merges several categories of a nominal variable into a smaller set, for example when thin categories make a table unstable.

Suppose marital status is coded one married, two widowed, three divorced, four separated, five never married. For a simple partnered against not-partnered comparison you collapse the five into two. Every source code needs a rule, so nothing is dropped.

Transform > Recode into Different Variables. Move marital in, name the Output Variable partnered, click Change, open Old and New Values, add the rules below. Continue, then OK.
Old and New Values mapping, five categories into two
Old ValueNew ValueNew group
1 (married)1Partnered
2 (widowed)2Not partnered
3 (divorced)2Not partnered
4 (separated)2Not partnered
5 (never married)2Not partnered

Handle the leftovers. If a variable has many codes and you only care about a few, map the ones you want and set All other values to a catch-all code or to system-missing on purpose, rather than leaving them to become accidental blanks. Then label partnered one for Partnered, two for Not partnered, and set its Measure to Nominal.

Common mistakes

  • Leaving a source code with no rule, which writes a blank and quietly shrinks your sample.
  • Collapsing groups that answer different questions, which hides a real difference in the data.
  • Skipping value labels, so the new variable reads as one and two with no meaning attached.

Recode, Compute or Visual Binning: which tool

Three tools change values, and each suits a different job. Pick by the shape of the mapping, not by habit.

ToolMenu pathBest for
Recode into Different VariablesTransform > Recode into Different VariablesAny value-to-value or range-to-value mapping: reverse scoring, binning, collapsing. Keeps the original.
Compute VariableTransform > Compute VariableA formula across the whole scale, such as new = 6 - old to reverse a 5-point item, or building a mean of items.
Visual BinningTransform > Visual BinningCutting a continuous variable into equal-width or equal-count bands, with cut points and labels written for you.

Procedure on this page was checked against the IBM SPSS Statistics documentation, the Laerd Statistics recoding guides, the UCLA OARC SPSS resources and the Kent State SPSS tutorials.

Or set up the recode with a statistician beside you

When a whole questionnaire needs reversing, the brackets are fussy, or a recode keeps writing blanks, a specialist builds it on your file and walks you through the mapping so you can defend it.

What one order includes: the recode done on your data with Recode into Different Variables, reversed items and grouped variables named and labelled, a Frequencies check that proves every case mapped, and a plain-language note on what changed. A syntax file is included so the recode is reproducible and easy to hand in.
1

Send your SPSS task

Upload your data file, the questionnaire or brief and your deadline, then get a free quote from support.

2

Pay securely

Approve the price and a statistician who works in SPSS every day sets up the recode right away.

3

Download the result

Get the recoded file, the syntax and a short explanation in your account, with free revisions if you need them.

Vetted and safe

Real statisticians, and your data protected

Your work goes to a specialist who passed a subject-specific statistics test and a background check, and who works in SPSS every day. What we deliver is a model answer and study aid for reference, and many students use it to learn the method and check their own recode.

Everything stays private. Your data and details are confidential, we never contact your school, payments are secure, and the work is original and plagiarism-checked.

Get SPSS help you can trust →

Every order includes

Original variable keptNew variables labelled Syntax file included100% human, no AI Data kept confidentialFree revisions
★★★★★
What students say
★★★★★

"If there was a 6 rating I would choose it. First of all customer service was better than I even expected and I expected top notch customer service."

Sean D.
Verified review
★★★★★

"This company is wonderful. I was able to depend on them all semester for my Statistics assignments. Dependable with competitive prices. Would definitely use again!"

LMJ
Verified review

Recoding in SPSS FAQ

Recode into Same Variables overwrites the original column, so the raw data is lost. Recode into Different Variables writes the result to a new column and leaves the original untouched. Always use Recode into Different Variables so you can check your work, undo a mistake and keep the original codes.

Open Transform > Recode into Different Variables, move the item in, name the output variable and click Change, then open Old and New Values. For a 5-point item map one to five, two to four, three to three, four to two and five to one, clicking Add after each pair, then Continue and OK. Do this before you compute a scale mean or run reliability.

Use Transform > Recode into Different Variables, name a new grouped variable and click Change, then in Old and New Values use the Range options. Map Lowest through 29 to one, 30 through 44 to two, 45 through 59 to three and 60 through Highest to four, then Continue and OK. Add value labels so the groups read as names.

Yes. Recode writes numbers only, so the new variable has no labels until you add them in Variable View under the Values column. Without labels your output shows bare codes such as one and two instead of the group names.

Both work. Recode maps each old value to a new one through a dialog. Compute reverses a scale with one formula, such as new = 6 minus old for a 5-point item, where the constant is the maximum plus one. Compute is faster for a whole set of items on the same scale; Recode is clearer when the mapping is irregular.

A blank means an old value had no rule, so nothing was written for that case. Check that every value is covered, that your ranges leave no gaps at the boundaries, and that you set All other values on purpose. Off-by-one range limits are the usual cause.

Get your SPSS recode done right

Hand it to a statistician and get reversed, binned and collapsed variables that keep your original data and pass a check before your deadline.

Get my free quote →

Related homework help

We use cookies to improve your experience. See our cookie policy.