Rstat Spearman
Transcript of Rstat Spearman
-
8/13/2019 Rstat Spearman
1/4
Package pspearman
August 29, 2013
Title Spearmans rank correlation test
Version 0.2-5
Date 2009-06-19
Author Petr Savicky
Maintainer Petr Savicky
Description Spearmans rank correlation test with precomputed exact null distribution for n
-
8/13/2019 Rstat Spearman
2/4
2 spearman.test
Usage
pspearman(s, n, lower.tail = TRUE,
approximation = c("exact", "AS89", "t-distribution"))
Arguments
s The observed value of S statistics sum((rank(x) - rank(y))^2).
n The number of observations.
lower.tail If TRUE (the default), the probability of S < = s is computed. If FALSE, the
probability ofS >= sis computed.
approximation Selection of the method of approximation of the distribution function.
Details
Seespearman.testfor more detail.
Value
Depending onlower.tail, either the probability of S = sis computed, where S is
the statistics sum((rank(x) - rank(y))^2).
Examples
pspearman(36, 1, approximation="exact") # [1] .5265377
pspearman(36, 1, approximation="AS89") # [1] .5825634
spearman.test Spearmans rank correlation test with precomputed null distribution
Description
This function is a modification of the part of the function cor.test(), which evaluates Spearmans
rank correlation test. Besides the two approximations used incor.test(,method="spearman"),
which are AS89 and the t-distribution, this function allows to use precomputed null distribution for
n
-
8/13/2019 Rstat Spearman
3/4
spearman.test 3
Details
Calculation of the null distribution of Spearmans rank correlation statistics is exponentially hard
in n. This package uses precomputed exact distribution for n
-
8/13/2019 Rstat Spearman
4/4
Index
Topicdistributionpspearman,1
Topichtestspearman.test,2
pspearman,1
spearman.test,2
4