permute.groups:
Does randomisation test for the difference in means of two vectors v1 and v2.
Description
Does randomisation test for the difference in means mu1, mu2
of two vectors v1 and v2. Can do one or two sided tests.
Usage
permute.groups(v1, v2, alternative, nreps)
Arguments
v1
Data vector for variable 1
v2
Data vector for variable 2
alternative
A character string specifying the alternative
hypothesis, must be one of "two.sided" (default), "greater" (mu1>mu2) or "less".
You can specify just the initial letter.
nreps
Number of replications used in the randomisation and generation of
the p-value. Default is nreps=999
Value
$p.value
Details
Under the null hypothesis that mu1=mu2, the labelling of the n1+n2 observations is unimportant.
Therefore, we can generate the null distribution for the test statistic m1-m2 or |m1-m2| depending
on whether a one
or two sided test is required) by randomly permuting the treatment labels nreps times and calculating the test statistic
each time. The p-value is calculated as suggested by Manly (2006).
References
Manly BFJ (2006) Randomization, Bootstrap And Monte Carlo Methods in Biology: 3rd edition. Chapman and Hall.