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.
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.
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 here. Alternately, we have a generic, "quick start" guide to show you how to enter data into SPSS Statistics, available here. 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.
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.
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 the site here.
Published with written permission from SPSS Statistics, IBM Corporation.
You will be presented with the Two-Related-Samples Tests dialogue box, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
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 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:
Published with written permission from SPSS Statistics, IBM Corporation.
Note:
button shifts the pair of variables you have highlighted down one level.
button shifts the pair of variables you have highlighted up one level.
button shifts the order of the variables within a variable pair.
If you want to generate descriptives or quartiles for your variables, select them by clicking the 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:
Published with written permission from SPSS Statistics, IBM Corporation.
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.
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.
Published with written permission from SPSS Statistics, IBM Corporation.
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.
Published with written permission from SPSS Statistics, IBM Corporation.
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.
Published with written permission from SPSS Statistics, IBM Corporation.
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 the site here, or learn more about our enhanced content in general here.