hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_nonpar_concordance_kendall (g08da)

Purpose

nag_nonpar_concordance_kendall (g08da) calculates Kendall's coefficient of concordance on kk independent rankings of nn objects or individuals.

Syntax

[w, p, ifail] = g08da(x, k, 'n', n)
[w, p, ifail] = nag_nonpar_concordance_kendall(x, k, 'n', n)

Description

Kendall's coefficient of concordance measures the degree of agreement between kk comparisons of nn objects, the scores in the iith comparison being denoted by
xi1,xi2,,xin.
xi1,xi2,,xin.
The hypothesis under test, H0H0, often called the null hypothesis, is that there is no agreement between the comparisons, and this is to be tested against the alternative hypothesis, H1H1, that there is some agreement.
The nn scores for each comparison are ranked, the rank rijrij denoting the rank of object jj in comparison ii, and all ranks lying between 11 and nn. Average ranks are assigned to tied scores.
For each of the nn objects, the kk ranks are totalled, giving rank sums RjRj, for j = 1,2,,nj=1,2,,n. Under H0H0, all the RjRj would be approximately equal to the average rank sum k(n + 1) / 2k(n+1)/2. The total squared deviation of the RjRj from this average value is therefore a measure of the departure from H0H0 exhibited by the data. If there were complete agreement between the comparisons, the rank sums RjRj would have the values k,2k,,nkk,2k,,nk (or some permutation thereof). The total squared deviation of these values is k2(n3n) / 12k2(n3-n)/12.
Kendall's coefficient of concordance is the ratio
W = ( j = 1n (Rj(1/2)k(n + 1)) 2 )/( (1/12) k2 (n3n) )
W = j=1 n ( Rj - 12 k(n+1) ) 2 112 k2 (n3-n)
and lies between 00 and 11, the value 00 indicating complete disagreement, and 11 indicating complete agreement.
If there are tied rankings within comparisons, WW is corrected by subtracting kTkT from the denominator, where T = (t3t) / 12T=(t3-t)/12, each tt being the number of occurrences of each tied rank within a comparison, and the summation of TT being over all comparisons containing ties.
nag_nonpar_concordance_kendall (g08da) returns the value of WW, and also an approximation, pp, of the significance of the observed WW. (For n > 7,k(n1)Wn>7,k(n-1)W approximately follows a χn12χn-12 distribution, so large values of WW imply rejection of H0H0.) H0H0 is rejected by a test of chosen size αα if p < αp<α. If n7n7, tables should be used to establish the significance of WW (e.g., Table R of Siegel (1956)).

References

Siegel S (1956) Non-parametric 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 ldxkldxk.
x(i,j)xij must be set to the value xijxij of object jj in comparison ii, for i = 1,2,,ki=1,2,,k and j = 1,2,,nj=1,2,,n.
2:     k – int64int32nag_int scalar
kk, the number of comparisons.
Constraint: k2k2.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The second dimension of the array x.
nn, the number of objects.
Constraint: n2n2.

Input Parameters Omitted from the MATLAB Interface

ldx rnk

Output Parameters

1:     w – double scalar
The value of Kendall's coefficient of concordance, WW.
2:     p – double scalar
The approximate significance, pp, of WW.
3:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
On entry,n < 2n<2.
  ifail = 2ifail=2
On entry,ldx < kldx<k.
  ifail = 3ifail=3
On entry,k1k1.

Accuracy

All computations are believed to be stable. The statistic WW 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 nknk.

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


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, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013