The Friedman test is the non-parametric alternative to the one-way ANOVA with repeated measures. It is used to test for differences between groups when the dependent variable being measured is ordinal. It can also be used for continuous data that has violated the assumptions necessary to run the one-way ANOVA with repeated measures (e.g., data that has marked deviations from normality).
When you choose to analyse your data using a Friedman test, part of the process involves checking to make sure that the data you want to analyse can actually be analysed using a Friedman test. You need to do this because it is only appropriate to use a Friedman test if your data "passes" the following four assumptions:
The Friedman test procedure in SPSS Statistics will not test any of the assumptions that are required for this test. In most cases, this is because the assumptions are a methodological or study design issue, and not what SPSS Statistics is designed for. In the case of assessing the types of variable you are using, SPSS Statistics will not provide you with any errors if you incorrectly label your variables as nominal.
A researcher wants to examine whether music has an effect on the perceived psychological effort required to perform an exercise session. The dependent variable is "perceived effort to perform exercise" and the independent variable is "music type", which consists of three groups: "no music", "classical music" and "dance music". To test whether music has an effect on the perceived psychological effort required to perform an exercise session, the researcher recruited 12 runners who each ran three times on a treadmill for 30 minutes. For consistency, the treadmill speed was the same for all three runs. In a random order, each subject ran: (a) listening to no music at all; (b) listening to classical music; and (c) listening to dance music. At the end of each run, subjects were asked to record how hard the running session felt on a scale of 1 to 10, with 1 being easy and 10 extremely hard. A Friedman test was then carried out to see if there were differences in perceived effort based on music type.
SPSS Statistics puts all repeated measures data on the same row in its Data View. Therefore, you will need as many variables as you have related groups. In our example, we need three variables, which we have labelled "none", "classical" and "dance" to represent the subjects' perceived effort when running based on the three different types of music.
Published with written permission from SPSS Statistics, IBM Corporation.
If you are still unsure how to enter your data correctly, we show you how to do this in our enhanced Friedman test guide. You can learn about our enhanced data setup content on our Features: Data Setup page, or our enhanced guides as a whole on our Features: Overview page.
The eight steps below show you how to analyse your data using a Friedman test in SPSS Statistics when none of the assumptions in the previous section, Assumptions, have been violated. At the end of these eight steps, we show you how to interpret the results from your Friedman test.
Click Analyze > Nonparametric Tests > Legacy Dialogs > K Related Samples... on the top menu, as shown below:
Note: Ignore Legacy Dialogs if on a previous version to SPSS Statistics 18.0
Published with written permission from SPSS Statistics, IBM Corporation.
You will be presented with the Tests for Several Related Samples dialogue box, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
Transfer the dependent variables none, classical and dance to the Test Variables: box by using the button or by dragging-and-dropping the variables into the box. You will end up with the following screen:
Published with written permission from SPSS Statistics, IBM Corporation.
Make sure that Friedman is selected in the –Test Type– area.
Click on the button. You will be presented with the following Several Related Samples: Statistics dialogue box, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
Tick the Quartiles option:
Note: It is most likely that you will only want to include the Quartiles option as your data is probably unsuitable for Descriptives (i.e., why you are running a non-parametric test). However, SPSS Statistics includes this option anyway.
Published with written permission from SPSS Statistics, IBM Corporation.
Click on the button. This will return you back to the Tests for Several Related Samples dialogue box, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
Click on the button to run the Friedman test.
SPSS Statistics will generate either two or three tables, depending on whether you selected to have descriptives and/or quartiles generated in addition to running the Friedman test.
The Descriptives Statistics table will be produced if you selected the Quartiles option:
Published with written permission from SPSS Statistics, IBM Corporation.
This is a very useful table because it can be used to present descriptive statistics in your results section for each of the time points or conditions (depending on your study design) for your dependent variable. This usefulness will be presented in the "Reporting the Output" section later.
The Ranks table shows the mean rank for each of the related groups, as shown below:
Published with written permission from SPSS Statistics, IBM Corporation.
The Friedman test compares the mean ranks between the related groups and indicates how the groups differed, and it is included for this reason. However, you are not very likely to actually report these values in your results section, but most likely will report the median value for each related group.
The Test Statistics table informs you of the actual result of the Friedman test, and whether there was an overall statistically significant difference between the mean ranks of your related groups. For the example used in this guide, the table looks as follows:
Published with written permission from SPSS Statistics, IBM Corporation.
The table above provides the test statistic (χ^{2}) value ("Chi-square"), degrees of freedom ("df") and the significance level ("Asymp. Sig."), which is all we need to report the result of the Friedman test. From our example, we can see that there is an overall statistically significant difference between the mean ranks of the related groups. It is important to note that the Friedman test is an omnibus test, like its parametric alternative; that is, it tells you whether there are overall differences, but does not pinpoint which groups in particular differ from each other. To do this you need to run post hoc tests, which will be discussed after the next section.
You can report the Friedman test result as follows:
There was a statistically significant difference in perceived effort depending on which type of music was listened to whilst running, χ^{2}(2) = 7.600, p = 0.022.
You could also include the median values for each of the related groups. However, at this stage, you only know that there are differences somewhere between the related groups, but you do not know exactly where those differences lie. Remember though, that if your Friedman test result was not statistically significant, you should not run post hoc tests.
To examine where the differences actually occur, you need to run separate Wilcoxon signed-rank tests on the different combinations of related groups. So, in this example, you would compare the following combinations:
You need to use a Bonferroni adjustment on the results you get from the Wilcoxon tests because you are making multiple comparisons, which makes it more likely that you will declare a result significant when you should not (a Type I error). Luckily, the Bonferroni adjustment is very easy to calculate; simply take the significance level you were initially using (in this case, 0.05) and divide it by the number of tests you are running. So in this example, we have a new significance level of 0.05/3 = 0.017. This means that if the p value is larger than 0.017, we do not have a statistically significant result.
Running these tests (see how with our Wilcoxon signed-rank test guide) on the results from this example, you get the following result:
Published with written permission from SPSS Statistics, IBM Corporation.
This table shows the output of the Wilcoxon signed-rank test on each of our combinations. It is important to note that the significance values have not been adjusted in SPSS Statistics to compensate for multiple comparisons – you must manually compare the significance values produced by SPSS Statistics to the Bonferroni-adjusted significance level you have calculated. We can see that at the p < 0.017 significance level, only perceived effort between no music and dance (dance-none, p = 0.008) was statistically significantly different.
You can report the Friedman test with post hoc tests results as follows:
There was a statistically significant difference in perceived effort depending on which type of music was listened to whilst running, χ^{2}(2) = 7.600, p = 0.022. Post hoc analysis with Wilcoxon signed-rank tests was conducted with a Bonferroni correction applied, resulting in a significance level set at p < 0.017. Median (IQR) perceived effort levels for the no music, classical and dance music running trial were 7.5 (7 to 8), 7.5 (6.25 to 8) and 6.5 (6 to 7), respectively. There were no significant differences between the no music and classical music running trials (Z = -0.061, p = 0.952) or between the classical and dance music running trials (Z = -1.811, p = 0.070), despite an overall reduction in perceived effort in the dance vs classical running trials. However, there was a statistically significant reduction in perceived effort in the dance music vs no music trial (Z = -2.636, p = 0.008).