[R] Permutation tests for correlations

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Wed Nov 30 17:44:19 CET 2005


On Wed, 30 Nov 2005, Peter Dalgaard wrote:

> Apropos the question about permutation tests in multiple regression:
>
> We do have perm.test in package ExactRankTests, but it does one- and

just for the record: exactRankTests.

> two-sample tests, as in t.test, wilcox.test, etc. There doesn't seem
> to be an exact version of the permutation test for correlations, i.e.,
> the one that could be estimated using
>
> replicate(10000, cor(x,sample(y))) # or other values of 10000
>
> or, of course, computed exactly by enumeration of all the
> permutations, which is feasible up to length(x) == 10 or so.
>
> So I'm wondering: Is this due to lack of theory/algorithm or just lack of
> implementation?

Lack of looking at the right package ;-)

The package `coin' provides conditional inference for the independence
problem in a rather flexible setup (in particular for arbitrary scales of
x  and y). It provides asymptotic p values as well as approximations (as
you suggest above) to the exact distribution for all types of data and
also the exact distribution if feasible. See
  vignette("coin", package = "coin")
for more details.

Best,
Z




More information about the R-help mailing list