The Friedman test is a non-parametric statistical test developed by Milton Friedman. Similar to the parametric repeated measures ANOVA, it is used to detect differences in treatments across multiple test attempts. The procedure involves ranking each row (or block) together, then considering the values of ranks by columns. Applicable to complete block designs, it is thus a special case of the Durbin test.
Contents
Classic examples of use are:
The Friedman test is used for one-way repeated measures analysis of variance by ranks. In its use of ranks it is similar to the Kruskal–Wallis one-way analysis of variance by ranks.
Friedman test is widely supported by many statistical software packages.
Method
- Given data
{ x i j } n × k n rows (the blocks),k columns (the treatments) and a single observation at the intersection of each block and treatment, calculate the ranks within each block. If there are tied values, assign to each tied value the average of the ranks that would have been assigned without ties. Replace the data with a new matrix{ r i j } n × k r i j x i j i . - Find the values:
-
r ¯ ⋅ j = 1 n ∑ i = 1 n r i j -
r ¯ = 1 n k ∑ i = 1 n ∑ j = 1 k r i j -
S S t = n ∑ j = 1 k ( r ¯ ⋅ j − r ¯ ) 2 -
S S e = 1 n ( k − 1 ) ∑ i = 1 n ∑ j = 1 k ( r i j − r ¯ ) 2 - The test statistic is given by
Q = S S t S S e - Finally, when n or k is large (i.e. n > 15 or k > 4), the probability distribution of Q can be approximated by that of a chi-squared distribution. In this case the p-value is given by
P ( χ k − 1 2 ≥ Q ) . If n or k is small, the approximation to chi-square becomes poor and the p-value should be obtained from tables of Q specially prepared for the Friedman test. If the p-value is significant, appropriate post-hoc multiple comparisons tests would be performed.
Related tests
Post hoc analysis
Post-hoc tests were proposed by Schaich and Hamerle (1984) as well as Conover (1971, 1980) in order to decide which groups are significantly different from each other, based upon the mean rank differences of the groups. These procedures are detailed in Bortz, Lienert and Boehnke (2000, p. 275).
Not all statistical packages support Post-hoc analysis for Friedman's test, but user-contributed code exists that provides these facilities (for example in SPSS, and in R.)