NAG FL Interface
g08daf (concordance_kendall)
1
Purpose
g08daf calculates Kendall's coefficient of concordance on independent rankings of objects or individuals.
2
Specification
Fortran Interface
Integer, Intent (In) |
:: |
ldx, k, n |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
x(ldx,n) |
Real (Kind=nag_wp), Intent (Inout) |
:: |
rnk(ldx,n) |
Real (Kind=nag_wp), Intent (Out) |
:: |
w, p |
|
C Header Interface
#include <nag.h>
void |
g08daf_ (const double x[], const Integer *ldx, const Integer *k, const Integer *n, double rnk[], double *w, double *p, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
g08daf_ (const double x[], const Integer &ldx, const Integer &k, const Integer &n, double rnk[], double &w, double &p, Integer &ifail) |
}
|
The routine may be called by the names g08daf or nagf_nonpar_concordance_kendall.
3
Description
Kendall's coefficient of concordance measures the degree of agreement between
comparisons of
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
and
, 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
. (For
approximately follows a
distribution, so large values of
imply rejection of
.)
is rejected by a test of chosen size
if
. If
, tables should be used to establish the significance of
(e.g., Table R of
Siegel (1956)).
4
References
Siegel S (1956) Non-parametric Statistics for the Behavioral Sciences McGraw–Hill
5
Arguments
-
1:
– Real (Kind=nag_wp) array
Input
-
On entry: must be set to the value of object in comparison , for and .
-
2:
– Integer
Input
-
On entry: the first dimension of the arrays
x and
rnk as declared in the (sub)program from which
g08daf is called.
Constraint:
.
-
3:
– Integer
Input
-
On entry: , the number of comparisons.
Constraint:
.
-
4:
– Integer
Input
-
On entry: , the number of objects.
Constraint:
.
-
5:
– Real (Kind=nag_wp) array
Workspace
-
-
6:
– Real (Kind=nag_wp)
Output
-
On exit: the value of Kendall's coefficient of concordance, .
-
7:
– Real (Kind=nag_wp)
Output
-
On exit: the approximate significance, , of .
-
8:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 4 in the Introduction to the NAG Library FL Interface 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 argument, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
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
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
On entry, .
Constraint: .
-
On entry, and .
Constraint: .
-
On entry, .
Constraint: .
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
All computations are believed to be stable. The statistic should be accurate enough for all practical uses.
8
Parallelism and Performance
g08daf is not threaded in any implementation.
The time taken by g08daf is approximately proportional to the product .
10
Example
This example is taken from page 234 of
Siegel (1956). The data consists of
objects ranked on three different variables:
X,
Y and
Z. 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,
Y,
Z may be rejected with reasonably high confidence.
10.1
Program Text
10.2
Program Data
10.3
Program Results