dSpearman(x, r, log=FALSE)
pSpearman(q, r, lower.tail=TRUE, log.p=FALSE)
qSpearman(p, r, lower.tail=TRUE, log.p=FALSE)
rSpearman(n, r)
sSpearman(r)
$$1-\frac{6d}{r(r^2-1)}$$
This is, in fact, the product-moment correlation coefficient of rank differences. See Kendall (1975), Chapter 2. It is identical to Friedman's chi-squared for two treatments scaled to the -1, 1 range -- if X is the Friedman statistic, then $\rho=frac{X}{r-1)-1}{rho = X/(r-1) -1}.
Exact calculations are made for \eqn{r \le 100}{r <= 100}<="" p="">
These exact calculations are made using the algorithm of Kendall and Smith (1939).
The incomplete beta, with continuity correction, is used for calculations outside this range.$
dSpearman()
gives the density, pSpearman()
the distribution function and qSpearman()
its inverse. rSpearman()
generates random numbers. sSpearman()
produces a list containing parameters corresponding to the arguments -- mean, median, mode, variance, sd, third cental moment, fourth central moment, Pearson's skewness, skewness, and kurtosis.
Kendall, M. and Smith, B.B. (1939). The problem of m rankings. Ann. Math. Stat. 10. 275-287.
[object Object]