← Other topics

How to Reverse Score Survey Items in R

Video Notes

What Is Reverse Scoring?

In survey research, reverse scoring is used when some items are phrased in the opposite direction of the construct being measured.

Example construct: Perceived Stress

Items:

  1. “I feel overwhelmed.”
  2. “I feel unable to cope.”
  3. “I feel calm.” ← reverse worded

If responses range from 1 (Strongly disagree) to 5 (Strongly agree):

So we reverse score that item so all items align directionally.

The Reverse Scoring Formula

The general formula is:

reverse_score = (min + max) - original

Common examples:

Scale Formula
1–5   6 - x
1–7   8 - x
0–4   4 - x
0–10  10 - x

Example for 1–5 scale:

1 → 5
2 → 4
3 → 3
4 → 2
5 → 1

This preserves spacing and keeps values within the original range.

R Function for Reverse Scoring

The following R function can be used to reverse columns in a data set:

library(dplyr)

# Function for reverse scoring
reverse_score_items <- function(
  data,
  columns_to_reverse,
  scale_min,
  scale_max
) {
  reverse_score <- function(values) {
    (scale_min + scale_max) - values
  }

  data %>%
    mutate(
      across(
        all_of(columns_to_reverse),
        reverse_score
      )
    )
}

Example

Let’s apply the above function to an example data set:

# Example data
survey_data <- tibble(
  id = 1:10,
  stress_1 = c(2, 4, 3, 5, 1, 2, 4, 3, 5, 1),
  stress_2 = c(3, 3, 2, 4, 5, 1, 2, 4, 3, 2),
  stress_3 = c(5, 1, 4, 2, 3, 5, 1, 4, 2, 3) # reverse-worded item
)

Assume:

To apply the function:

# Apply reverse scoring
survey_data_reverse_scored <- reverse_score_items(survey_data, c('stress_3'), 1, 5)

Results:

A tibble: 10 × 4
      id stress_1 stress_2 stress_3
   <int>    <dbl>    <dbl>    <dbl>
 1     1        2        3        1
 2     2        4        3        5
 3     3        3        2        2
 4     4        5        4        4
 5     5        1        5        3
 6     6        2        1        1
 7     7        4        2        5
 8     8        3        4        2
 9     9        5        3        4
10    10        1        2        3
>

Unlock all the notes for $4

No subscriptions, no auto-renewals.

Just a simple one-time payment that helps support my free, to-the-point videos without sponsered ads.

Unlocking gets you access to the notes for this video plus all 200+ guides on this site.

Your support is appreciated. Thank you!

Payment Info

/
$4 6 months
$25 forever
Please check the form for errors
Questions? help@codewithsusan.com
← Other topics