NAG Library Routine Document
G08DAF calculates Kendall's coefficient of concordance on independent rankings of objects or individuals.
||LDX, K, N, IFAIL
||X(LDX,N), RNK(LDX,N), W, P
Kendall's coefficient of concordance measures the degree of agreement between
objects, the scores in the
th comparison being denoted by
The hypothesis under test,
, often called the null hypothesis, is that there is no agreement between the comparisons, and this is to be tested against the alternative hypothesis,
, that there is some agreement.
The scores for each comparison are ranked, the rank denoting the rank of object in comparison , and all ranks lying between and . Average ranks are assigned to tied scores.
For each of the objects, the ranks are totalled, giving rank sums , for . Under , all the would be approximately equal to the average rank sum . The total squared deviation of the from this average value is therefore a measure of the departure from exhibited by the data. If there were complete agreement between the comparisons, the rank sums would have the values (or some permutation thereof). The total squared deviation of these values is .
Kendall's coefficient of concordance is the ratio
and lies between
, the value
indicating complete disagreement, and
indicating complete agreement.
If there are tied rankings within comparisons, is corrected by subtracting from the denominator, where , each being the number of occurrences of each tied rank within a comparison, and the summation of being over all comparisons containing ties.
G08DAF returns the value of
, and also an approximation,
, of the significance of the observed
approximately follows a
distribution, so large values of
imply rejection of
is rejected by a test of chosen size
, tables should be used to establish the significance of
(e.g., Table R of Siegel (1956)
Siegel S (1956) Non-parametric Statistics for the Behavioral Sciences McGraw–Hill
- 1: X(LDX,N) – REAL (KIND=nag_wp) arrayInput
On entry: must be set to the value of object in comparison , for and .
- 2: LDX – INTEGERInput
: the first dimension of the arrays X
as declared in the (sub)program from which G08DAF is called.
- 3: K – INTEGERInput
On entry: , the number of comparisons.
- 4: N – INTEGERInput
On entry: , the number of objects.
- 5: RNK(LDX,N) – REAL (KIND=nag_wp) arrayWorkspace
- 6: W – REAL (KIND=nag_wp)Output
On exit: the value of Kendall's coefficient of concordance, .
- 7: P – REAL (KIND=nag_wp)Output
On exit: the approximate significance, , of .
- 8: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
All computations are believed to be stable. The statistic should be accurate enough for all practical uses.
The time taken by G08DAF is approximately proportional to the product .
This example is taken from page 234 of Siegel (1956)
. The data consists of
objects ranked on three different variables: X
. The computed values of Kendall's coefficient is significant at the
level of significance
, indicating that the null hypothesis of there being no agreement between the three rankings X
may be rejected with reasonably high confidence.
9.1 Program Text
Program Text (g08dafe.f90)
9.2 Program Data
Program Data (g08dafe.d)
9.3 Program Results
Program Results (g08dafe.r)