Calculates probabilities for Spearman’s rank correlation statistic (D.B. Baird).
No options
Parameters
N = scalars |
Numbers of pairs of observations |
---|---|
CORRELATION = scalars |
Values of the signed rank statistic |
CLPROBABILITY = scalars |
Cumulative lower probability of CORRELATION |
CUPROBABILITY = scalars |
Cumulative upper probability of CORRELATION |
PROBABILITY = scalars |
Probability density of CORRELATION |
UPROBABILITIES = variates |
Probability densities of CORRELATION …1 |
UCORRELATION = variates |
Values of CORRELATION at corresponding elements of UPROBABILITIES |
Description
PRSPEARMAN
calculates various probabilities for Spearman’s rank correlation coefficient (see procedure SPEARMAN
). These can be used to give a nonparametric assessment of whether paired samples are correlated.
correlation = ∑i=1…N ((Ri-(N+1)/2) × (Si-(N+1)/2)) / (N × (N2-1) / 12
where Ri and Si are the ranks of Xi and Yi respectively.
The number of sample pairs of observations is specified by the N
parameter, and the CORRELATION
parameter specifies the value of the rank correlation for which the probabilities are required. The CLPROBABILITY
and CUPROBABILITY
parameters can specify scalars to save the cumulative lower and upper probabilities,
Pr.(s ≤ CORRELATION
)
and
Pr.(s > CORRELATION
)
respectively. PROBABILITY
can save the probability density at CORRELATION
,
Pr.(s == CORRELATION
),
UPROBABILITIES
can save a variate containing the densities for CORRELATION
…1, and UCORRELATION
can save the values of CORRELATION
for the elements in UPROBABILITIES
.
Options: none.
Parameters: N
, CORRELATION
, CLPROBABILITY
, CUPROBABILITY
, PROBABILITY
, UPROBABILITIES
, UCORRELATION
.
Method
The procedure uses PASS
to call an external program which calculates the coefficients of the generating function for the Spearman rank correlation coefficient under the null hypothesis using recurrence functions (see van de Weil et al. 1999). A t approximation is used when N exceeds 20.
Action with RESTRICT
Restrictions are not applicable to any of the parameters.
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: SPEARMAN
.
Commands for: Basic and nonparametric statistics.
Example
CAPTION 'PRSPEARMAN example',\ !t('Calculate the Table 6.2 of Sen & Krishnaiah (1984,',\ 'Handbook of Statistics. Volume 4, Chapter 37, p.954)',\ 'Note: Table 6.2 has mistakenly printed 2*s rather than s.');\ STYLE=meta,plain VARIATE [VALUES=0.005,0.01,0.025,0.05] PLevel; DECIMALS=3 & [VALUES=4...16] 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 PRSPEARMAN n; CORRELATION=0; UPROBABILITIES=upr CALCULATE cupr = CUMULATE(upr) & CN[]$[i] = SUM(cupr < #PLevel) - 1 & Pos[] = CN[]$[i] + 1 + (CN[]$[i] < 0) & Pr[]$[i] = cupr$[Pos[]] & Pr[]$[i] = MVINSERT(Pr[]$[i];CN[]$[i] < 0) & CN[]$[i] = MVINSERT(CN[]$[i];CN[]$[i] < 0) DELETE [Redefine=yes] upr,cupr ENDFOR FOR [NTIMES=1] 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 ENDFOR