# [R] A naive question about permutation tests in the coin package

Ista Zahn izahn at psych.rochester.edu
Tue Oct 27 01:18:01 CET 2009

```Anybody? As a social psychology student I run a lot of experiments,
randomization tests, and want to implement them in R. My googleing and
perusal of CRAN led me to the coin package, but due to the issues
described in my original post I'm not sure I'm on the right track.
Comments or suggestions, either for other packages to look at or for
reference materials that will help me use the coin package will be
greatly appreciated (I've tried to understand the vignettes provided
with the package but it's challenging for me).

Thanks,
Ista

On Sun, Oct 25, 2009 at 1:33 AM, Ista Zahn <izahn at psych.rochester.edu> wrote:
> Dear R helpers,
> I am trying to understand how to use the independence_test function in
> the coin package. I think I suffer from a misunderstanding about what
> the package does. Either that or I do not understand how to use it
> properly. Specifically, I cannot understand if I can test independence
> of arbitrary statistics.
>
> Take the following example:
>
> set.seed(10)
> d <- data.frame(y = c(rnorm(10, mean=3, sd = 5), rnorm(10, mean = 4,
> sd = 4)), x = c(rep("condA", 10), rep("condB", 10)))
>
> I've figured out how to do
>
> (m.perm <- independence_test(y ~ x, data=d, distribution="exact"))
>
> which tells me (I think) that the probability of these data assuming
> no difference between the two groups is .0026. But unfortunately I
> don't know what that means. My (limited) understanding of permutation
> tests is that they can be used with arbitrary test statistics. But the
> coin documentation indicates that only three teststats can be used:
> "max", "quad" and "scalar". Without understanding what these are, I
> don't feel that I understand the test.
>
> Questions:
> 1) What are "max", "quad" and "scalar"? (book/article references would
> be appreciated)
> 2) Can I use arbitrary test statistics with coin? For example, can I
> test the independence of the variances using coin?
>
> Thanks,
> Ista
>
>
>
>
>
>
>
>
> --
> Ista Zahn
> University of Rochester
> Department of Clinical and Social Psychology
> http://yourpsyche.org
>

--
Ista Zahn
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org

```