The Friedmann Test for Paired Samples

5.4.2 The Friedmann Test for Paired Samples

The Friedman test can be considered the non-parametric counterpart of the two- way ANOVA test described in section 4.5.3. The test assesses whether c-paired samples, each with n cases, are from the same population or from populations with continuous distributions and the same median. The variable being tested must be at least of ordinal type. The test procedure starts by assigning natural ordered ranks from 1 to c to the matched case values in each row, from the smallest to the largest. Tied ranks are substituted by their average.

Commands 5.11. SPSS, STATISTICA, MATLAB and R commands used to perform the Friedmann test.

SPSS Analyze; Nonparametric Tests; K Related

Samples STATISTICA Statistics; Nonparametrics; Comparing multiple dep. samples (groups)

MATLAB [p,table,stats]=friedman(x,reps) R

friedman.test(x, group) | friedman.test(x~group)

Let R i denote the sum of ranks for sample i. Under the null hypothesis, we expect that each R i will exhibit a small deviation from the value that would be obtained by chance, i.e., n(c + 1)/2. The test statistic is:

12 R 2 − 3 n 2 c ( c + 1 ) ∑ 2 i

. 5.40 nc ( c + 1 )

216 5 Non-Parametric Tests of Hypotheses

Tables with the exact probabilities of F r , under the null hypothesis, can be found in the literature. For c > 5 or for n > 15 F r has an asymptotic chi-square distribution with df = c – 1 degrees of freedom.

When there are tied ranks, a correction is inserted in formula 5.40, subtracting from nc(c + 1) in the denominator the following term:

nc −

t ∑∑ 3 i . j

where t i.j is the number of ties in group j of g i tied groups in the ith row. The power-efficiency of the Friedman test, when compared with its parametric counterpart, the two-way ANOVA, is 64% for c = 2 and increases with c, namely to 80% for c = 5.

Example 5.24

Q: Consider the evaluation of a sample of eight metallurgic firms ( Metal Firms’ dataset), in what concerns social impact, with variables: CEI = “commitment to environmental issues”; IRM = “incentive towards using recyclable materials”; EMS = “environmental management system”; CLC = “co-operation with local community”; OEL = “obedience to environmental legislation”. Is there evidence at a 5% level that all variables have distributions with the same median?

Table 5.28. Scores and ranks of the variables related to “social impact” in the Metal Firms dataset (Example 5.24).

Data Ranks

Firm #5 2 2 1 1 1 4.5 4.5 2 2 2 Firm #6

A: Table 5.28 lists the scores assigned to the eight firms. From the scores, the ranks are computed as previously described. Note particularly how ranks are assigned in the case of ties. For instance, Firm #1 IRM, EMS and CLC are tied for rank 1 through 3; thus they get the average rank 2. Firm #1 CEI and OEL are tied for

5.4 Inference on More Than Two Populations

ranks 4 and 5; thus they get the average rank 4.5. Table 5.29 lists the results of the Friedman test, obtained with SPSS. Based on these results, the null hypothesis is rejected at 5% level (or even at a smaller level).

Table 5.29. Results obtained with SPSS for the Friedman test of social impact scores of the Metal Firms’ dataset: a) mean ranks, b) significance.

Mean Rank

N8

CEI 4.13 IRM 2.56