1. Home
2. PRKTAU procedure

# PRKTAU procedure

Calculates probabilities for Kendall’s rank correlation coefficient τ (D.B. Baird).

### Parameters

`N` = scalars Sizes of the first groups of observations Values of Kendall’s τ statistic Cumulative lower probability of `TAU` Cumulative upper probability of `TAU` Probability density of `TAU` Probability densities of -1…`TAU` 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 = iN { Sign(xixj) × Sign(yiyj) } }.

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.

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,Pr,CN,Pr,CN,Pr,CN,Pr;\
DECIMALS=(0,4)3; FIELD=4,7
```
Updated on March 6, 2019