Calculates probabilities for Kendall’s rank correlation coefficient τ (D.B. Baird).
No options
Parameters
N = scalars |
Sizes of the first groups of observations |
---|---|
TAU = scalars |
Values of Kendall’s τ statistic |
CLPROBABILITY = scalars |
Cumulative lower probability of TAU |
CUPROBABILITY = scalars |
Cumulative upper probability of TAU |
PROBABILITY = scalars |
Probability density of TAU |
LPROBABILITIES = variates |
Probability densities of -1…TAU |
LTAU = variates |
Values of Tau at corresponding values of LPROBABILITIES |
Description
PRKTAU
calculates various probabilities for the Kendall’s rank correlation coefficient, τ (tau). The τ statistic arises from Kendall’s rank correlation test, which can be used to give a nonparametric assessment as to whether paired samples are correlated. τ is calculated as
T / NCOMBINATIONS(N; 2)
where T is
∑i = 1…N { ∑j = i…N { Sign(xi – xj) × Sign(yi – yj) } }.
The number of sample pairs of observations is specified by the N
parameter, and the TAU
parameter specifies the value of the Kendall rank correlation coefficient for which the probabilities are required. The CLPROBABILITY
and CUPROBABILITY
parameters can specify scalars to save the cumulative lower and upper probabilities, pr(s ≤= τ) and pr(s > τ) respectively. PROBABILITY
can save the probability density at τ, pr(s = τ), and LPROBABILITIES
can save a variate containing the densities for -1…τ, and LTAU
can save the values of τ for the elements in LPROBABILITIES
.
Options: none.
Parameters: N
, TAU
, CLPROBABILITY
, CUPROBABILITY
, PROBABILITY
, LPROBABILITIES
, LTAU
.
Method
The procedure calculates the coefficents of the generating function for the Kendall rank correlation coefficient under the null hypothesis using recurrence functions (See van de Weil et al. 1999). The central limit theorem is used when N exceeds 35, and a Normal approximation of the cumulative density function is returned.
Reference
van de Wiel, M.A. Di Bucchianico, A. & van de Laan, P. (1999). Symbolic computation and exact distributions of nonparametric test statistics. The Statistician, 48, 507-516.
See also
Procedure: KTAU
.
Commands for: Basic and nonparametric statistics.
Example
CAPTION 'PRKTAU example',!t(\ 'Calculate the Table 6.1 of Sen & Krishnaiah (1984,',\ 'Handbook of Statistics. Volume 4, Chapter 37, p. 953)');\ STYLE=meta,plain VARIATE [VALUES=0.005,0.01,0.025,0.05] PLevel; DECIMALS=3 & [VALUES=4...35] N; DECIMALS=0 & [NVALUES=N] Pr[1,2,3,4] & [NVALUES=N] CN[1,2,3,4] POINTER [NVALUES=NVALUES(PLevel)] Pos FOR [INDEX=i] n = #N PRKTAU n; TAU=0; LPROBABILITIES=lpr CALCULATE clpr = CUMULATE(lpr) & CN[]$[i] = SUM(clpr < #PLevel) - 1 & Pos[] = CN[]$[i] + 1 + (CN[]$[i] < 0) & Pr[]$[i] = clpr$[Pos[]] & Pr[]$[i] = MVINSERT(Pr[]$[i];CN[]$[i] < 0) & CN[]$[i] = MVINSERT(CN[]$[i];CN[]$[i] < 0) DELETE [Redefine=yes] lpr,clpr ENDFOR PRINT [ORIENT=Across] PLevel; FIELD=11 PRINT [MISSING=' ';IPRINT=*;SQUASH=yes] \ CN[1],Pr[1],CN[2],Pr[2],CN[3],Pr[3],CN[4],Pr[4];\ DECIMALS=(0,4)3; FIELD=4,7