Login

Wilcoxon Signed-Rank Test using SPSS Statistics

Introduction

The Wilcoxon signed-rank test is the nonparametric test equivalent to the dependent t-test. As the Wilcoxon signed-rank test does not assume normality in the data, it can be used when this assumption has been violated and the use of the dependent t-test is inappropriate. It is used to compare two sets of scores that come from the same participants. This can occur when we wish to investigate any change in scores from one time point to another, or when individuals are subjected to more than one condition.

For example, you could use a Wilcoxon signed-rank test to understand whether there was a difference in smokers' daily cigarette consumption before and after a 6 week hypnotherapy programme (i.e., your dependent variable would be "daily cigarette consumption", and your two related groups would be the cigarette consumption values "before" and "after" the hypnotherapy programme). You could also use a Wilcoxon signed-rank test to understand whether there was a difference in reaction times under two different lighting conditions (i.e., your dependent variable would be "reaction time", measured in milliseconds, and your two related groups would be reaction times in a room using "blue light" versus "red light").

This "quick start" guide shows you how to carry out a Wilcoxon signed-rank test using SPSS Statistics, as well as interpret and report the results from this test. However, before we introduce you to this procedure, you need to understand the different assumptions that your data must meet in order for a Wilcoxon signed-rank test to give you a valid result. We discuss these assumptions next.

SPSS Statistics

Assumptions

When you choose to analyse your data using a Wilcoxon signed-rank test, part of the process involves checking to make sure that the data you want to analyse can actually be analysed using a Wilcoxon signed-rank test. You need to do this because it is only appropriate to use a Wilcoxon signed-rank test if your data "passes" three assumptions that are required for a Wilcoxon signed-rank test to give you a valid result. The first two assumptions relate to your study design and the types of variables you measured. The third assumption reflects the nature of your data and is the one assumption you test using SPSS Statistics. These three assumptions as briefly explained below:

In the section, Test Procedure in SPSS Statistics, we illustrate the SPSS Statistics procedure to perform a Wilcoxon signed-rank test. First, we introduce the example that is used in this "quick start" guide.

SPSS Statistics

Example

A pain researcher is interested in finding methods to reduce lower back pain in individuals without having to use drugs. The researcher thinks that having acupuncture in the lower back might reduce back pain. To investigate this, the researcher recruits 25 participants to their study. At the beginning of the study, the researcher asks the participants to rate their back pain on a scale of 1 to 10, with 10 indicating the greatest level of pain. After 4 weeks of twice weekly acupuncture, the participants are asked again to indicate their level of back pain on a scale of 1 to 10, with 10 indicating the greatest level of pain. The researcher wishes to understand whether the participants' pain levels changed after they had undergone the acupuncture, so a Wilcoxon signed-rank test is run.

In our enhanced Wilcoxon signed-rank test guide, we show you how to correctly enter data in SPSS Statistics to run a Wilcoxon signed-rank test. You can learn about our enhanced data setup content on our Features: Data Setup page. Alternately, see our generic, "quick start" guide: Entering Data in SPSS Statistics. In our enhanced Wilcoxon signed-rank test guide, we also explain how to deal with missing values in your data set (e.g., if a participant completed a pre-test, but failed to turn up to the post-test). In the next section, we take you through the Wilcoxon signed-rank test procedure using SPSS Statistics.

Testimonials
TAKE THE TOUR


SPSS Statistics

Test Procedure in SPSS Statistics

The six steps below show you how to analyse your data using a Wilcoxon signed-rank test in SPSS Statistics. At the end of these six steps, we show you how to interpret the results from this test.

  1. Click Analyze > Nonparametric Tests > Legacy Dialogs > 2 Related Samples... on the top menu, as shown below:

    Note: We show you the legacy procedure in SPSS Statistics to run the Wilcoxon signed-rank test below since this can be used with older versions of SPSS Statistics (17 and below), as well as more recent versions (version 18 and above). However, you can also run the Wilcoxon signed-rank test using the new procedure in SPSS Statistics, which is available for versions 18 and above. This newer procedure provides additional statistics and more graphical options than the legacy procedure. We show you how to run the new procedure and interpret and report the output from it in our enhanced Wilcoxon signed-rank test guide. You can access the enhanced Wilcoxon signed-rank test guide by subscribing to Laerd Statistics.

    Menu for the Wilcoxon signed-rank test in SPSS Statistics

    Published with written permission from SPSS Statistics, IBM Corporation.

  2. You will be presented with the Two-Related-Samples Tests dialogue box, as shown below:
    'Two-Related-Samples Tests' dialogue box for the Wilcoxon signed-rank test in SPSS Statistics. Variables on the left

    Published with written permission from SPSS Statistics, IBM Corporation.

  3. Transfer the variables you are interested in analysing into the Test Pairs: box. In our example, we need to transfer the variables Pain_Score_Pre and Pain_Score_Post, which represent the Pain Scores before and after the acupuncture intervention, respectively. There are two ways to do this. You can either: (1) highlight both variables (use the cursor and hold down the shift key), and then press the Right arrow button; or (2) drag-and-drop each variable into the boxes. Make sure that the Wilcoxon checkbox is ticked in the –Test Type– area. You will end up with a screen similar to the one below:
    'Two-Related-Samples Tests' dialogue box. Wilcoxon signed-rank test in SPSS. Variables transferred into boxes on the right

    Published with written permission from SPSS Statistics, IBM Corporation.

    Note:
    Down arrow button shifts the pair of variables you have highlighted down one level.
    Up arrow button shifts the pair of variables you have highlighted up one level.
    Double arrow button shifts the order of the variables within a variable pair.

  4. If you want to generate descriptives or quartiles for your variables, select them by clicking on the Options button and ticking the Descriptive and Quartiles checkboxes in the –Statistics– area. Also, you can decide how to deal with missing values. You will end up with a screen similar to the one below:
    'Two-Related-Samples Tests: Options' dialogue box. Wilcoxon signed-rank test in SPSS. 'Descriptive' & 'Quartiles' selected

    Published with written permission from SPSS Statistics, IBM Corporation.

  5. Click on the Continue button. You will be returned to the Two-Related-Samples Tests dialogue box.
  6. Click on the OK button.
Join the 10,000s of students, academics and professionals who rely on Laerd Statistics.TAKE THE TOUR
SPSS Statistics

SPSS Statistics Output of the Wilcoxon Signed-Rank Test

SPSS Statistics generates a number of tables in the Output Viewer under the title NPar Tests. In this section, we focus on these three tables to help you understand the results you may obtain when running a Wilcoxon signed-rank test on your data.

Descriptives Table

The Descriptive Statistics table is where SPSS Statistics has generated descriptive and quartile statistics for your variables if you selected these options. If you did not select these options, this table will not appear in your results. You can use the results from this table to describe the Pain Score scores before and after the acupuncture treatment. As you have used a nonparametric test it is most likely that you should use the quartiles information to describe both your groups.

'Descriptive Statistics' table for the Wilcoxon signed-rank test in SPSS. Shows descriptive statistics for each variable

Published with written permission from SPSS Statistics, IBM Corporation.

Ranks Table

The Ranks table provides some interesting data on the comparison of participants' Before (Pre) and After (Post) Pain Score. We can see from the table's legend that 11 participants had a higher pre-acupuncture treatment Pain Score than after their treatment. However, 4 participants had a higher Pain Score after treatment and 10 participants saw no change in their Pain Score.

'Ranks' table for the Wilcoxon signed-rank test in SPSS. Shows 'Negative Ranks', 'Positive Ranks', 'Ties' & 'Total'

Published with written permission from SPSS Statistics, IBM Corporation.

Test Statistics Table

By examining the final Test Statistics table, we can discover whether these changes, due to acupuncture treatment, led overall to a statistically significant difference in Pain Scores. We are looking for the "Asymp. Sig. (2-tailed)" value, which in this case is 0.071. This is the p-value for the test. We report the Wilcoxon signed-ranks test using the Z statistic.

'Test Statistics b' table for the Wilcoxon signed-rank test in SPSS Statistics. Shows 'Z' and 'Asymp. Sig. (2-tailed)'

Published with written permission from SPSS Statistics, IBM Corporation.


Reporting the Output from the Wilcoxon Sign-Rank Test

Based on the results above, we could report the results of the study as follows:

A Wilcoxon signed-rank test showed that a 4 week, twice weekly acupuncture treatment course did not elicit a statistically significant change in lower back pain in individuals with existing lower back pain (Z = -1.807, p = 0.071). Indeed, median Pain Score rating was 5.0 both pre- and post-treatment.

In our enhanced Wilcoxon signed-rank test guide, we: (a) show you how to interpret and write up the results of the Wilcoxon signed-rank test irrespective of whether you ran the legacy procedure (as illustrated in this guide) or the newer procedure in SPSS Statistics; (b) provide a more detailed explanation of how to interpret median values and paired differences, as well as negative ranks, positive ranks and ties, and finally, asymptotic p-values; and (c) illustrate how to write up the results from your Wilcoxon signed-rank test procedure if you need to report this in a dissertation/thesis, assignment or research report. We do this using the Harvard and APA styles. You can access our enhanced Wilcoxon signed-rank test guide, as well as all of our SPSS Statistics content, by subscribing to Laerd Statistics, or learn more about our enhanced content in general on our Features: Overview page.

Join the 10,000s of students, academics and professionals who rely on Laerd Statistics.TAKE THE TOUR
1