PDF version (NAG web site
, 64bit version, 64bit version)
NAG Toolbox: nag_nonpar_concordance_kendall (g08da)
Purpose
nag_nonpar_concordance_kendall (g08da) calculates Kendall's coefficient of concordance on k$k$ independent rankings of n$n$ objects or individuals.
Syntax
[
w,
p,
ifail] = nag_nonpar_concordance_kendall(
x,
k, 'n',
n)
Description
Kendall's coefficient of concordance measures the degree of agreement between
k$k$ comparisons of
n$n$ objects, the scores in the
i$i$th comparison being denoted by
The hypothesis under test,
H_{0}${H}_{0}$, often called the null hypothesis, is that there is no agreement between the comparisons, and this is to be tested against the alternative hypothesis,
H_{1}${H}_{1}$, that there is some agreement.
The n$n$ scores for each comparison are ranked, the rank r_{ij}${r}_{ij}$ denoting the rank of object j$j$ in comparison i$i$, and all ranks lying between 1$1$ and n$n$. Average ranks are assigned to tied scores.
For each of the n$n$ objects, the k$k$ ranks are totalled, giving rank sums R_{j}${R}_{j}$, for j = 1,2, … ,n$j=1,2,\dots ,n$. Under H_{0}${H}_{0}$, all the R_{j}${R}_{j}$ would be approximately equal to the average rank sum k(n + 1) / 2$k(n+1)/2$. The total squared deviation of the R_{j}${R}_{j}$ from this average value is therefore a measure of the departure from H_{0}${H}_{0}$ exhibited by the data. If there were complete agreement between the comparisons, the rank sums R_{j}${R}_{j}$ would have the values k,2k, … ,nk$k,2k,\dots ,nk$ (or some permutation thereof). The total squared deviation of these values is k^{2}(n^{3} − n) / 12${k}^{2}({n}^{3}n)/12$.
Kendall's coefficient of concordance is the ratio
and lies between
0$0$ and
1$1$, the value
0$0$ indicating complete disagreement, and
1$1$ indicating complete agreement.
If there are tied rankings within comparisons, W$W$ is corrected by subtracting k ∑ T$k\sum T$ from the denominator, where T = ∑ (t^{3} − t) / 12$T=\sum ({t}^{3}t)/12$, each t$t$ being the number of occurrences of each tied rank within a comparison, and the summation of T$T$ being over all comparisons containing ties.
nag_nonpar_concordance_kendall (g08da) returns the value of
W$W$, and also an approximation,
p$p$, of the significance of the observed
W$W$. (For
n > 7,k(n − 1)W$n>7,k(n1)W$ approximately follows a
χ_{n − 1}^{2}${\chi}_{n1}^{2}$ distribution, so large values of
W$W$ imply rejection of
H_{0}${H}_{0}$.)
H_{0}${H}_{0}$ is rejected by a test of chosen size
α$\alpha $ if
p < α$p<\alpha $. If
n ≤ 7$n\le 7$, tables should be used to establish the significance of
W$W$ (e.g., Table R of
Siegel (1956)).
References
Siegel S (1956) Nonparametric Statistics for the Behavioral Sciences McGraw–Hill
Parameters
Compulsory Input Parameters
 1:
x(ldx,n) – double array
ldx, the first dimension of the array, must satisfy the constraint
ldx ≥ k$\mathit{ldx}\ge {\mathbf{k}}$.
x(i,j)${\mathbf{x}}\left(\mathit{i},\mathit{j}\right)$ must be set to the value
x_{ij}${x}_{\mathit{i}\mathit{j}}$ of object
j$\mathit{j}$ in comparison
i$\mathit{i}$, for
i = 1,2, … ,k$\mathit{i}=1,2,\dots ,k$ and
j = 1,2, … ,n$\mathit{j}=1,2,\dots ,n$.
 2:
k – int64int32nag_int scalar
k$k$, the number of comparisons.
Constraint:
k ≥ 2${\mathbf{k}}\ge 2$.
Optional Input Parameters
 1:
n – int64int32nag_int scalar
Default:
The second dimension of the array
x.
n$n$, the number of objects.
Constraint:
n ≥ 2${\mathbf{n}}\ge 2$.
Input Parameters Omitted from the MATLAB Interface
 ldx rnk
Output Parameters
 1:
w – double scalar
The value of Kendall's coefficient of concordance, W$W$.
 2:
p – double scalar
The approximate significance, p$p$, of W$W$.
 3:
ifail – int64int32nag_int scalar
ifail = 0${\mathrm{ifail}}={\mathbf{0}}$ unless the function detects an error (see
[Error Indicators and Warnings]).
Error Indicators and Warnings
Errors or warnings detected by the function:
 ifail = 1${\mathbf{ifail}}=1$

On entry,  n < 2${\mathbf{n}}<2$. 
 ifail = 2${\mathbf{ifail}}=2$

On entry,  ldx < k$\mathit{ldx}<{\mathbf{k}}$. 
 ifail = 3${\mathbf{ifail}}=3$

On entry,  k ≤ 1${\mathbf{k}}\le 1$. 
Accuracy
All computations are believed to be stable. The statistic W$W$ should be accurate enough for all practical uses.
Further Comments
The time taken by nag_nonpar_concordance_kendall (g08da) is approximately proportional to the product nk$nk$.
Example
Open in the MATLAB editor:
nag_nonpar_concordance_kendall_example
function nag_nonpar_concordance_kendall_example
x = [1, 4.5, 2, 4.5, 3, 7.5, 6, 9, 7.5, 10;
2.5, 1, 2.5, 4.5, 4.5, 8, 9, 6.5, 10, 6.5;
2, 1, 4.5, 4.5, 4.5, 4.5, 8, 8, 8, 10];
k = int64(3);
[w, p, ifail] = nag_nonpar_concordance_kendall(x, k)
w =
0.8277
p =
0.0078
ifail =
0
Open in the MATLAB editor:
g08da_example
function g08da_example
x = [1, 4.5, 2, 4.5, 3, 7.5, 6, 9, 7.5, 10;
2.5, 1, 2.5, 4.5, 4.5, 8, 9, 6.5, 10, 6.5;
2, 1, 4.5, 4.5, 4.5, 4.5, 8, 8, 8, 10];
k = int64(3);
[w, p, ifail] = g08da(x, k)
w =
0.8277
p =
0.0078
ifail =
0
PDF version (NAG web site
, 64bit version, 64bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013