KENDP
Computes the frequency distribution of the total score in Kendall’s rank correlation coefficient.
Required Arguments
NOBS — Sample size. (Input)
Must be greater than 1 and less than 34 (56 on some computers).
K — Score for which the probability is to be calculated. (Input)
K must be in the range from minus to plus NOBS * (NOBS  1)/2, inclusive.
FRQ — Vector of length NOBS * (NOBS  1)/2 + 1 containing the frequency distribution of possible values of K. (Output)
K will range from minus to plus NOBS * (NOBS  1)/2, inclusive, in increments of 2, with frequency FRQ(i), for a possible K = 2 * (i  1)  NOBS * (NOBS  1)/2, where i = 1, 2, NOBS * (NOBS  1)/2 + 1.
PROB — Probability of equaling or exceeding K if the samples on which K is based are uncorrelated. (Output)
FORTRAN 90 Interface
Generic: CALL KENDP (NOBS, K, FRQ, PROB)
Specific: The specific interface names are S_KENDP and D_KENDP.
FORTRAN 77 Interface
Single: CALL KENDP (NOBS, K, FRQ, PROB)
Double: The double precision name is DKENDP.
Description
Routine KENDP computes the frequency distribution of the Kendall S statistic and the probability that S equals or exceeds a given value K. Routine KENDP requires the sample size, n = NOBS, on input. The frequencies reported in position i of FRQ correspond to
S = 2(i  1)  n(n  1)/2
To obtain the probability distribution of S, divide each frequency by the sum of the frequencies in FRQ.
The upper bound on NOBS that can be handled by KENDP depends upon the largest real number that can be represented in the computer being used (AMACH(2)). If this value is 1.0E+46 or less, NOBS cannot be greater than 33.
Comments
Workspace may be explicitly provided, if desired, by use of K2NDP/DK2NDP.
The reference is:
CALL K2NDP (NOBS, K, FRQ, PROB, FWK)
The additional argument is:
FWK — Work vector of length (NOBS  1) * (NOBS  2)/2 + 1.
Example
The frequency distribution S for NOBS of 4 is computed. The probability is computed for S = 4.
 
USE IMSL_LIBRARIES
 
IMPLICIT NONE
INTEGER K, NOBS
PARAMETER (K=4, NOBS=4)
!
INTEGER I, M, NOUT
REAL FRQ(NOBS*(NOBS-1)/2+1,3), PROB, SUM
CHARACTER CLABEL(4)*10, RLABEL(1)*10
!
DATA RLABEL/'NONE'/
DATA CLABEL/' ', 'S', 'FRQ', 'pf'/
!
M = NOBS*(NOBS-1)/2 + 1
DO 10 I=1, M
FRQ(I,1) = 2*(I-1) - NOBS*(NOBS-1)/2
10 CONTINUE
!
CALL KENDP (NOBS, K, FRQ(1:,2), PROB)
! Compute the probabilities
SUM = SSUM(M,FRQ(1:,2),1)
CALL SCOPY (M, FRQ(1:,2), 1, FRQ(1:,3), 1)
CALL SSCAL (M, 1.0/SUM, FRQ(1:,3), 1)
! Print results
CALL UMACH (2, NOUT)
CALL WRRRL (' ', FRQ, RLABEL, CLABEL, FMT='(W10.4)')
WRITE (NOUT,*) 'PROB = ', PROB
END
Output
 
S FRQ pf
-6.000 1.000 0.042
-4.000 3.000 0.125
-2.000 5.000 0.208
0.000 6.000 0.250
2.000 5.000 0.208
4.000 3.000 0.125
6.000 1.000 0.042
PROB = 0.16666667
Published date: 03/19/2020
Last modified date: 03/19/2020