Time commitment
5 - 10 minutes
Description
The purpose of this video is to explain the Wilcoxon signed-rank test, a non-parametric statistical test used to compare the medians of two paired continuous or ordinal variables. The video covers key assumptions required for the test, such as the type of dependent and independent variables and the need for a symmetrical difference score distribution. It also provides a step-by-step guide to running the test in SPSS, including navigating the software’s interface, selecting the correct options, and interpreting the output.
Video
Transcript
[Lindsay Plater, PhD, Data Analyst II]
So, what is a Wilcoxon signed-rank test?
A Wilcoxon signed-rank test is used to determine whether the median of two continuous [or ordinal] variables from the same group of participants differ.
This is a non-parametric test, which means that the data do not assume normality; they do not have to follow the standard bell-shaped curve. And if you're looking for some additional help running the Wilcoxon signed-rank rank test, you can find that in the University of Guelph SPSS LibGuide, the Laerd statistics guide, or the SPSS documentation.
Alright, we have three main assumptions of our Wilcoxon signed-rank test.
The first is that your dependent variable must be ordinal or continuous. The second is that your independent variable must be categorical with two paired groups or conditions. And the third is that the distribution of the difference score must be symmetrical; this one is specific to this test, we’ll check this one in a few slides. Let's go.
Check assumptions (ordinal / continuous dependent variable)
[Slide contains a screenshot of a table in SPSS within Data View. The table’s column headers are as follows: Gender, Fake_Data1, Fake_Data2, Fake_Data3, Fake_Data4, Colour, and Group.]
Alright, so checking our first assumption: that the dependent variable must be either ordinal or continuous. We're going to be using Fake_Data1 and Fake_Data2.
[Fake_Data1 and Fake_Data2 columns are highlighted.]
We can look in these columns of data and say: “What kind of data do we have here?” Here we've got a range of values, we've got a bunch of decimals, those are giveaways that this is probably continuous data. So, we've passed our first assumption.
Our second assumption is that our independent variable must be categorical, and that you must have two matched groups or conditions.
[First three columns (Gender, Fake_Data1, and Fake_Data2) of rows 1 and 16 are highlighted.]
So, if we use, for example, our Gender column as our independent variable, here we see we have male participants and female participants; we have different groups. And the part about being matched is, for example, in row #1 we've got a participant who identifies as male, and they have a Fake_Data1 score and a Fake_Data2 score. This is paired data because each participant has these two observations, and we're going to be comparing the observations between Fake_Data1 and Fake_Data2. So, we've passed this assumption as well.
Our last assumption for the Wilcoxon signed-rank test is about the distribution.
The difference score distribution must be symmetrical. I've shortcut us a little bit here, since we've already seen this in the paired samples t-test; this is our histogram, our graph of our difference score. If you need a refresh on how to do the difference score, run back to the paired sample t-test video. You can also get this graph once you run the Wilcoxon signed-rank test, but technically you're supposed to check it before, so I'm just putting it here before so we can do that.
[The histogram displays the distribution of diff_score values, with Frequency on the y-axis and diff_score values on the x-axis. The diff_score values range from 2 to 10, and the frequency values from left to right are 1, 3, 4, 3, 7, 5, 6, 0, and 1.]
What we're looking for here, is we're looking to see: “Does the left side of the graph look like the right side of the graph? Does it look symmetrical?” If I draw a line through the middle, for example, and I look at the two different sizes of the graph, does it look like a mirror reflection? Here, we can see the distribution does not look symmetrical; it's really easy to see if you just kind of draw a line in the middle midpoint [values in the first half or left side: 1, 3, 4, and 3, and the second half or right side: 7, 5, 6, 0, and 1]. The right side has higher frequencies than the left side. So, it might not be appropriate to run this test, so potentially we failed this assumption.
[Slide shows the table in Data View.]
Okay. If we pretend we've passed all of our assumptions, for practice, how do you actually run this test? You click Analyze > Nonparametric Tests > Related Samples. This is one of those dialog boxes that's kind of complicated; it doesn't have the exact name of the test because there are different kinds of tests that could be related samples. So, if you remember to yourself, “I'm doing the non-parametric version of a paired samples t-test; paired means related or repeated, I'm going to go Analyze > Nonparametric [Tests] > Related Samples because they're matched groups”. So again, we have not passed all of our assumptions, so it might not be appropriate to run this test on the fake data, but I'm going to show you how to run the test anyway. And this is a reminder to always check your assumptions. Alright, let's go.
If you click those options, you will get the “Nonparametric Tests: Two or More Related Samples” dialog box with three separate tabs and you have to click something in each tab.
The first thing you're going to do is in the Objective tab, you will click on “Customize analysis”. Then you have to remember to click to the next tab, which is the Fields tab.
In the Fields tab, you're going to take your two columns of dependent variable data, and you're going to move them from the left side under “Fields:” and put it on the right side where it says, “Test Fields:”. So, you’re going to grab Fake_Data1 and Fake_Data2 and move them to the right-hand side of the screen.
Then you have to remember to click the Settings tab. Once you click the Settings tab [with Choose Tests selected in the Select an item section], you'll click “Customize [tests]”, and under the heading “Compare Median Difference to Hypothesized”, you're going to click where it says, “Wilcoxon matched-pair signed-ranks (2 samples)”.
So, you've got something to click in each bucket, in Settings you're going to click “Wilcoxon matched-pair signed-rank” because that's the test you're doing.
If you've remembered to click something in all three of your tabs, you're going to click Run and that will pop out the non-parametric tests in your output.
[This screenshot from SPSS displays the Nonparametric Tests output, specifically for the Wilcoxon Signed-Rank Test. The two tables shown here are the Hypothesis Test Summary and Related-Samples Wilcoxon Signed Rank Test Summary. The Output Navigator is in the panel on the left-hand side.]
There're a few things to look at here. The first table is your Hypothesis Test Summary table. This puts in words what your null hypothesis is, which test you ran, the significance value of that test, and what decision you should make based on the significance value.
So you could look at your p-value at the top [in the Sig column of the Hypothesis Test Summary table], or you could look at the p-value a little bit lower in your output [in the Asymptotic Sig. (2-sided test) row] where it says “Related-Samples Wilcoxon Signed Rank Test Summary”, it's another table. These are the same value; they're giving you the same information. And here, if p is less than (<) .05, you can say you have found a difference between your two variables [the value shown is < .001].
So, in this case, there's a difference between Fake_Data1 and Fake_Data2. If p is greater than (>) .05, you can say we failed to find a difference.
If you scroll down just a little bit more, it will also spit out that same graph [Histogram] we used just a few slides ago, and this is another place where you can check and look and say does the left side look like the right side? Is it symmetrical. Here, this would be a giveaway that we probably shouldn't be using this test, so if you forgot to check it in advance and you check it here, you should go “Oh no, oops, I maybe can't run this test because the sides don't look symmetrical”.
And that is how you run a Wilcoxon signed-rank test.
License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
- Ask Chat is a collaborative service
- Ask Us Online Chat hours
- Contact Us