The Friedman test investigates the score differences between
matched samples of size
, the scores in the
th sample being denoted by:
(Thus the sample scores may be regarded as a two-way table with
rows and
columns.) The hypothesis under test,
, often called the null hypothesis, is that the samples come from the same population, and this is to be tested against the alternative hypothesis
that they come from different populations.
The test is based on the observed distribution of score rankings between the matched observations in different samples.
The test proceeds as follows:
-
(a)The scores in each column are ranked, denoting the rank within column of the observation in row . Average ranks are assigned to tied scores.
-
(b)The ranks are summed over each row to give rank sums , for .
-
(c)The Friedman test statistic is computed, where
g08aec returns the value of
, and also an approximation,
, to the significance of this value. (
approximately follows a
distribution, so large values of
imply rejection of
).
is rejected by a test of chosen size
if
. The approximation
is acceptable unless
and
, or
and
, or
and
; for
or
, tables should be consulted (e.g.,
n of
Siegel (1956)); for
the Sign test (see
g08aac) or Wilcoxon test (see
g08agc) is in any case more appropriate.
-
1:
– Integer
Input
-
On entry:
, the number of samples.
Constraint:
.
-
2:
– Integer
Input
-
On entry: the size of each sample, .
Constraint:
.
-
3:
– const double
Input
-
On entry: must be set to the value, , of observation in sample , for and .
-
4:
– Integer
Input
-
On entry: the stride separating matrix column elements in the array
x.
Constraint:
.
-
5:
– double *
Output
-
On exit: the value of the Friedman test statistic, .
-
6:
– double *
Output
-
On exit: the approximate significance, , of the Friedman test statistic.
-
7:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
For estimates of the accuracy of the significance
, see
g01ecc. The
approximation is acceptable unless
and
, or
and
, or
and
.
Background information to multithreading can be found in the
Multithreading documentation.
This example is taken from page 169 of
Siegel (1956). The data relate to training scores of three matched samples of 18 rats, trained under three different patterns of reinforcement.