Exact testing with random permutations

When permutation methods are used in practice, often a limited number of random permutations are used to decrease the computational burden. However, most theoretical literature assumes that the whole permutation group is used, and methods based on random permutations tend to be seen as approximate. There exists a very limited amount of literature on exact testing with random permutations, and only recently a thorough proof of exactness was given. In this paper, we provide an alternative proof, viewing the test as a “conditional Monte Carlo test” as it has been called in the literature. We also provide extensions of the result. Importantly, our results can be used to prove properties of various multiple testing procedures based on random permutations.


Introduction
Permutation tests are nonparametric tests that are used in particular when the null hypothesis implies distributional invariance under certain transformations (Fisher 1936;Lehmann and Romano 2005;Ernst et al. 2004). Apart from permutations, other groups of transformations can be used, such as rotations (Langsrud 2005).
B Jesse Hemerik j.b.a.hemerik@lumc.nl When the set of transformations used is not a group, a permutation test can be very conservative or anti-conservative. The first author who explicitly assumed a group structure is Hoeffding (1952). The role of the group structure has recently been emphasized (Southworth et al. 2009;Goeman and Solari 2010). Southworth et al. (2009) note that in particular the set of 'balanced permutations' cannot be used, since it is not a group.
Often it is computationally infeasible to use the whole group of permutations, due to its large cardinality. In that case, random permutations are used, as was first proposed by Dwass (1957). Often a permutation p value based on random permutations is simply seen as an estimate of the permutation p value.
It is known that naively using random permutations instead of all possible permutations can lead to extreme anti-conservativeness (Phipson and Smyth 2010), especially when combined with multiple testing procedures. Therefore, sometimes the identity permutation, which corresponds to the original observation, is included with the random permutations (Ge et al. 2003;Lehmann and Romano 2005). Lehmann and Romano (2005) (p. 636) state that when the identity is added, the estimated p value is stochastically larger than the uniform distribution on [0, 1] under the null. Phipson and Smyth (2010) note that adding the identity can make the permutation test exact, i.e. of level α exactly. They do not mention the role of the underlying group structure. Instead, they view the permutation test as a Monte Carlo test, which is known to be exact in some situations if the original observation is added.
Referring to Monte Carlo is not sufficient, because despite being related, a Monte Carlo test is very different from a permutation test. Monte Carlo samples are drawn from the null distribution. In the permutation context, the random permutations of the data are instead drawn from a conditional null distribution, i.e. the permutation distribution. Hence, the proof by Phipson and Smyth (2010) is incomplete and it remained unclear what assumptions (e.g. a group structure) are essential for the validity of random permutation tests. For example, it is unclear from Phipson and Smyth that random sampling from balanced permutations would lead to invalid tests.
In Hemerik and Goeman (2017), a test is given based on random transformations. In the present paper, we extend this work, investigating fundamental properties of random permutation tests. Our main focus is on the level of tests. Other properties, e.g. consistency, do not generally hold, but can be established for more specific scenarios (Lehmann and Romano 2005;Pesarin 2015; Pesarin and Salmaso 2013) by using results presented here. Our results are general and can be used to prove properties of various multiple testing methods based on random permutations, such as Westfall and Young (1993), Tusher et al. (2001), Meinshausen and Bühlmann (2005) and Meinshausen (2006). In the literature, there are two approaches to proving permutation tests with fixed permutations: a conditioning-based approach (Pesarin 2015) and a more direct approach (Hoeffding 1952;Lehmann and Romano 2005). We will give proofs with both approaches.
The structure of the paper is as follows. In Sect. 2, we review known results on the level of a permutation test based on a fixed group of transformations. The concepts and definitions from Sect. 2 are used throughout the paper. Testing with random permutations is covered in Sect. 3. In Sect. 3.1, permutation tests are contrasted with Monte Carlo tests. Estimation of p values is discussed in Sect. 3.2. Exact tests and p values based on random transformation are given in Sects. 3.3 and 3.4. In Sect. 4, some additional applications of these results are mentioned.

Fixed transformations
Here we discuss tests that use the full group of transformations.

Basic permutation test
Let X be data taking values in a sample space X . Let G be a finite set of transformations g : X → X , such that G is a group with respect to the operation of composition of transformations. This means that G satisfies the following three properties: G contains an identity element (the map x → x); every element of G has an inverse in G; for all a 1 , a 2 ∈ G, a 1 • a 2 ∈ G. This assumption of a group structure for G is fundamental throughout the paper, since it ensures that Gg = G for all g ∈ G, i.e. that the set G is permutation invariant.
Considering a general group of transformations rather than only permutations is useful, since in many practical situations the group consists of, for example, rotations (Langsrud 2005;Solari et al. 2014) or maps that multiply part of the data by −1 (Pesarin and Salmaso 2010, pp. 54 and 168). We write g(X ) as g X. Consider any test statistic T : X → R. Throughout this paper, we are concerned with testing the following null hypothesis of permutation invariance.
Definition 1 Let H p be any null hypothesis which implies that the joint distribution of the test statistics T (g X), g ∈ G, is invariant under all transformations in G of X . That is, writing for all g ∈ G.
Note that (1) holds in particular when for all g ∈ G X d = g X.
Composite null hypotheses are usually not of the form H p , but for specific scenarios, properties of tests of such hypotheses can be established using results in this paper. The most basic permutation test rejects H p when T (X ) > T (k) (X ), where are the sorted test statistics T (g X), g ∈ G, and k = (1 − α)#G with α ∈ [0, 1). As is known and stated in the following theorem, this test has level at most α.
We now give two proofs: a conditioning-based approach and an approach without conditioning. Both approaches are more or less known. The conditioning-based proof is similar to that in Pesarin (2015), but the setting is more general. For each x ∈ X , define O x to be the orbit of x, which is the set {gx : g ∈ G} ⊆ X .
Proof Let A = {x ∈ X : T (x) > T (k) (x)} be the set of elements of the sample space that lead to rejection. Suppose H p holds. By the group structure, Gg = G for all g ∈ G.
Endow the space of orbits with the σ -algebra that it inherits from the σ -algebra on X . Analogously to the proof of Theorem 15.2.2 in Lehmann and Romano (2005), we obtain By the argument above, this is bounded by α. Hence, as was to be shown.
We now state a different proof without conditioning. A similar proof can be found in Hoeffding (1952) and Lehmann and Romano (2005) (p. 634).
Proof By the group structure, Gg = G for all g ∈ G. Hence, T (k) (g X) = T (k) (X ) for all g ∈ G. Let h have the uniform distribution on G. Then, under H p , the rejection probability is The first equality follows from the null hypothesis, and the second equality holds since Since h is uniform on G, the above probability equals as was to be shown.
The test of Theorem 1 is not always exact. When the data are discrete, then the basic permutation test is often slightly conservative, due to a nonzero probability of tied values in X . Under the following condition, which is often satisfied for continuous data, but usually not for discrete data, the test is exact for certain values of α.
Condition 1 There is a partition {G 1 , . . . , G m } of G with id ∈ G 1 and #G 1 = · · · = #G m , such that under H p with probability 1 for all g, g ∈ G, T (g X) = T (g X ) if and only if g and g are in the same set G i .

Proposition 1 Under Condition 1, the test of Theorem 1 is exact if and only if
The proof of this result is analogous to the proof of Theorem 1. As an example where Condition 1 holds, consider a randomized trial where X ∈ R 2n and the test statistic is where X 1 , . . . , X n are cases and X n+1 , . . . , X 2n are controls and all X i are independent and identically distributed under the null. Let If the observations are continuous, then the set of α for which the test is exact is 0, 1/m, . . . , (m − 1)/m , reflecting the fact that there are m equivalence classes of size n!n! of permutations that always give the same test statistic.
The test of Theorem 1 is often conservative when the data are discrete, since then Condition 1 is usually not satisfied. Moreover, in many cases, the value 0.05 is not in the set mentioned in Proposition 1, and hence, the permutation test for α = 0.05 is conservative, even if Condition 1 is satisfied. The test can be adapted to be exact by randomizing it, i.e. by rejecting H p with a suitable probability a in the boundary case that T (X ) = T (k) (Hoeffding 1952). Here where This adaptation has the advantage that it is always exact. Even if Condition 1 is satisfied, the adaptation can be useful to guarantee that the level of the test is exactly the nominal level α. On the other hand, this test is less reproducible than the test of Theorem 1, since its outcome may depend on a random decision. Which test is to be preferred would depend on the context.
When the set G is not a group, the test can be highly anti-conservative or conservative. For example, the set of balanced permutations is a subset of the set of all permutations, but is not a subgroup. These permutations have been used in various papers since they can have an intuitive appeal. They are discussed in Southworth et al. (2009), who warn against their use since they lead to anti-conservative tests. The fact that permutations have been used incorrectly illustrates that more emphasis should be put on the assumption of a group structure.
Intuitively, the reason why a group structure is needed for Theorem 1 is the following. Suppose for simplicity that H p implies that X d = g X for all g ∈ G. The permutation test works since under H p , for every permutation g ∈ G the probability P{T (g X) > T (k) (X )} is the same. The reason is that under H p , for every g ∈ G, the joint distribution of g X and the set G X, i.e. of (g X, G X), is the same. Indeed, since G = Gg (group structure), the set G X is a function of g X, When G is not a group, the joint distribution of g X and the set G X is not generally independent of g.

Permutation p values
Permutation p values are p value based on permutations of the data. Here we will discuss permutation p values based on the full permutation group. p values based on random permutations are considered in Sect. 3.4.
It is essential to note that there is often no unique null distribution of T (X ), since H p often does not specify a unique null distribution of the data. Correspondingly, When a test statistic t is a function (which is not random) of the data and has a unique distribution under a hypothesis H , then a p value in the strict sense, P H (t ≥ t obs ), is defined where t obs is the observed value of t. Since under H p T (X ) does not always have a unique null distribution, often there exists no p value in the strict sense based on this test statistic. However, under Condition 1 the statistic does have a unique null distribution. Thus, a p value in the strict sense based on −D is then defined. Denoting by d the observed value of D, we have under H p This is indeed what is usually considered to be the permutation p value. This equality holds under Condition 1. In other cases, such as when the observations are discrete, the null hypothesis often does not specify a unique null distribution of D. Thus, there is not always a p value in the strict sense based on D.
When H p does not specify a unique null distribution of any sensible test statistic, as a resolution a 'worst-case' p value could be defined. However, sometimes better solutions are possible, e.g. the randomized p value p in Sect. 3.4. In general, a p value in the weak sense can be considered, i.e. any random variable p satisfying P( p ≤ c) ≤ c for all c ∈ [0, 1] for every distribution under the null hypothesis. For H p , D/#G is always a p value in the weak sense.

Random transformations
In Sect. 3, we extend the results of the previous section to tests based on random transformations. Since permutation testing with random permutations is often confused with Monte Carlo testing, in Sect. 3.1 the differences between the two are made explicit. Since random permutations are often used for estimation (rather than exact computation) of p values, estimation of permutation p values is discussed in Sect. 3.2. Exact tests and p values are given in Sects. 3.3 and 3.4, respectively. These two sections contain most of the novel results of the paper.

Comparison of Monte Carlo and permutation tests
In a basic Monte Carlo experiment, the null hypothesis H 0 is that X follows a specific distribution. A Monte Carlo test is used when there is no analytical expression for the (1 − α)-quantile of the null distribution of T (X ), such that the observed value of T (X ) cannot simply be compared to this quantile. To test H 0 , independent realizations X 2 , . . . , X w are drawn from the null distribution of X . Assume that T (X ), T (X 2 ), . . . , T (X w ) are continuous. Writing X 1 = X , let and let b denote its observed value. It is easily verified that under H 0 , B has the uniform distribution on {1, . . . , w}.
The Monte Carlo test rejects H 0 when T (X ) > T (k ) , where k = (1 − α)w and T (1) ≤ · · · ≤ T (w) are the sorted test statistics T (X j ), 1 ≤ j ≤ w. Note that T (k ) is not the exact (1 − α)-quantile of the null distribution of T (X ), but nevertheless the test is exact. The reason is that the null distribution of B is known. The test rejects H 0 if and only if − B exceeds the (1 − α)-quantile of its null distribution. Equivalently, it rejects when the Monte Carlo p value The validity of a random permutation test is not as obvious. Let g 2 , . . . , g w be random permutations from G. (There are various ways of sampling them, which we discuss later.) One permutation, g 1 , is fixed to be id ∈ G, reflecting the original observation. Then, similarly to a Monte Carlo test, the permutation test rejects H p if and only if T (X ) > T (k ) (X ), where now T (1) ≤ · · · ≤ T (w) are the sorted test statistics T (g j X ), 1 ≤ j ≤ w.
Note that contrary to the Monte Carlo sample X 1 , . . . , X w , the permutations g 1 X, . . . , g w X are not independent under the null. Thus, the random permutation test is not analogous to the Monte Carlo test. To prove the validity of the test based on random permutations, we must use that g 1 X, . . . , g w X are independent and identically distributed conditionally on the orbit O X . It is, however, not obvious what properties G should have in order that g 1 X = X can be seen as a random draw from O X condi-tionally on O X . It will be seen that it suffices that G is a group. In that case, the test can be said to be a 'conditional Monte Carlo test'.

Estimated p values
In practice, it is often computationally infeasible to calculate the permutation p value based on the whole permutation group, D/#G. To work around this problem, there are two approaches in the literature. In both approaches, random permutations are used. The first approach is calculating (rather than estimating) a p value based on the random permutations. This is discussed in Sect. 3.4. The second approach is estimating the p value D/#G, which we discuss now.
In practice, the p value p = D/#G is often estimated using random permutations. The random permutations are typically all taken to be uniform on G and can be drawn with or without replacement. The estimate of p is often taken to bep = B/w, with B as defined above. This is an unbiased estimate of p, i.e. Ep = p, and usually lim w→∞p = p.
Using the unbiased estimatep = B/w can be very dangerous, as Phipson and Smyth (2010) thoroughly explain. The reason is thatp is almost never stochastically larger than the uniform distribution on [0, 1] under H p . This is immediately clear from the fact thatp usually has a strictly positive probability of being zero. Consequently, if H p is rejected ifp ≤ c for some cut-off c, then the type I error rate can be larger than c. Often this difference will be small for large w. However, when c is itself small due to, for example, Bonferroni's multiple testing correction, then P(p ≤ c) can become many times larger than c under H p . This is because this probability does not converge to zero as c ↓ 0 for fixed w. Thus, as Phipson and Smyth (2010) note, usingp in combination with, for example, Bonferroni can lead to completely faulty inference. Appreciable anti-conservativeness also occurs if very few (e.g. 25-100) random permutations are used [as in, for example, Byrne et al. (2013) and Schimanski et al. (2013)].
When possible, computing exact p values is always to be preferred over estimating p values. Exact p values based on random permutations are given in Sect. 3.4.

Random permutation tests
Here we discuss exact tests based on random transformations. Apart from Theorem 2 (Hemerik and Goeman 2017), the results in this section are novel.
Phipson and Smyth (2010) also consider exact p values based on random permutations. The proofs in Phipson and Smyth (2010) are incomplete, since they do not show the role of the group structure of the set of all permutations. Lehmann and Romano (2005) (p. 636) remark without proof that if G is a group, then under H p the p value (B + 1)/(w + 1) is always stochastically larger than uniform on [0, 1], but they state no other properties. In Hemerik and Goeman (2017) for the first time, a theoretical foundation is given for the random permutation test, using the group structure of the set G. Here this work is extended with additional results.
Theorem 2 states that the permutation test with random permutations has level at most α if the identity map is added. This was remarked several times in the literature and proved in Hemerik and Goeman (2017). We first define the vector of random transformations.
Definition 2 Let G be the vector (id, g 2 , . . . , g w ), where id is the identity in G and g 2 , . . . , g w are random elements from G. Write g 1 = id. The transformations can be drawn either with or without replacement: the statements in this paper hold for both cases. If we draw g 2 , . . . , g w without replacement, then we take them to be uniformly distributed on G\{id}, otherwise uniform on G. In the former case, w ≤ #G.

Reject H p when T (X, G ) > T (k ) (X, G ). Then, the rejection probability under H p is at most α.
A proof of Theorem 2 is in Hemerik and Goeman (2017), and we recall it here.
Proof From the group structure of G, it follows that for all 1 ≤ j ≤ w, G g −1 j and G have the same distribution, if we disregard the order of the elements. Let j have the uniform distribution on {1, . . . , w} and write h = g j . Under H p , Since h = g j with j uniform, this equals as was to be shown.
We now prove Theorem 2 with a conditioning-based approach, viewing the test as a "conditional Monte Carlo" test as it has been called in the literature.
Proof We prove the result for the case of drawing with replacement. The proof for drawing without replacement is analogous. Note that (X, G ) takes values in X ×

such that the test rejects if and only if (X, G ) ∈ A.
Endow the space of orbits with the σ -algebra that it inherits from the σ -algebra on X . Suppose H p holds. Assume that almost surely O X contains #G distinct elements. In case not, the proof is analogous. Analogously to the proof of Theorem 15.2.2 in Lehmann and Romano (2005), we obtain We now argue that this is at most α. Fix X . LetX have the uniform distribution on O X . It follows from the group structure of G that the entries of G X are just independent uniform draws from O X . Thus, from the Monte Carlo testing principle it follows that P{(X , G ) ∈ A ≤ α. Since (X , G ) was uniformly distributed on O X × {id} × G w−1 , it follows that (4) is at most α. We conclude that as was to be shown.
Theorem 2 implies that (B + 1)/(w + 1) is always a p value in the weak sense if all random permutations (including g 1 ) are uniform draws with replacement from G or without replacement from G\{g 1 }. Under more specific assumptions, Theorem 2 can be extended to certain composite null hypotheses. Proposition 2 states that under Condition 1 and suitable sampling, the test with random permutations is exact. The formula in Sect. 3.4 for the p value under sampling without replacement is equivalent to the last part of this result.
Proof We consider the case that g 2 , . . . , g w are drawn without replacement from {h 2 , . . . , h m } and show that the test is exact for α ∈ {0/w, . . . , (w−1)/w}. Write G = (g 1 , . . . , g w ). Let h have the uniform distribution on {g 1 , . . . , g w }. For each g ∈ G let i(g) ∈ {1, . . . , m} be such that g ∈ G i(g) . Suppose H p holds. From the group structure of G, it follows that the sets i(g 1 ), . . . , i(g w ) and i(g 1 h −1 ), . . . , i(g w h −1 ) have the same distribution. Consequently, As in the above proof of Theorem 2, we find that this equals P T (h X) > T (k ) (X, G ) .
Since α ∈ {0/w, . . . , (w − 1)/w} and T (g 1 X ), . . . , T (g w X ) are distinct, it holds with probability one that Using this result, it can be shown that specific tests with random permutations are unbiased. The test of Theorem 2 can be slightly conservative if α is not chosen suitably or due to the possibility of ties. Recall that the same holds for the basic permutation test that uses all transformations in G. The adaptation by Hoeffding at (3) then guarantees exactness. The following is a generalization of Hoeffding's result to random transformations.

Proposition 3 Consider the setting of Theorem
where

Reject if T (X ) > T (k ) (X, G ) and reject with probability a if T (X ) = T (k ) (X, G ).
Then, the rejection probability is exactly α under H p .
Proof Assume H p holds. Note that Write M + = M + (X, G ) and M 0 = M 0 (X, G ). Analogously to the first four steps of the second proof of Theorem 2, it follows for h as defined there that the above equals as was to be shown.
The test of Proposition 3 entails a randomized decision: in case T (X ) = T (k ) , the test randomly rejects with probability a. This is in itself not objectionable, since the test is randomized anyway due to the random transformations. Note that in the situation of Proposition 2 under drawing without replacement the test is already exact, such that Proposition 3 is not needed to obtain an exact test.
In Theorem 2, the requirement of using the whole group is replaced by suitable random sampling from the group. Interestingly, the following sampling scheme is also possible. Let G * ⊆ G be any finite subset of G, where we now allow G to be an infinite group as well. Write k * = (1 − α)#G * . Let h be uniformly distributed on G * and independent. Reject H p if and only if i.e. if T (X ) exceeds the (1 − α)-quantile of the values T (gh −1 ), g ∈ G * . This is a randomized rejection rule, since it depends on h, which is randomly drawn each time the test is executed. The rejection probability is at most α, which follows from an argument analogous to the last five steps of the first proof of Theorem 2. Note that if G * is a group itself, then G * h −1 = G * and this test becomes nonrandom, coinciding with the basic permutation test. Thus, it is a generalization thereof. This result allows using a permutation test when G is an infinite group of transformations, from which it may not be obvious how to sample uniformly. One simply uses any finite subset G * of the infinite group.

p values based on random transformations
Phipson and Smyth (2010) give formulas for p values, when permutations are randomly drawn. Here we provide the required assumptions and proofs, which follow from Sect. 3.3. We then provide some additional results. Write where g 1 , . . . , g w are random permutations with distribution to be specified. Let b be the observed value of B. Under Condition 1, Phipson and Smyth's p values are exactly equal to P H p (− B ≥ − b). Under Condition 1, if g 1 , . . . , g w are drawn such that they are from distinct elements G i of the partition and not from G 1 , the p value The validity of this formula follows from Proposition 2. For the case that permutations are drawn with replacement, where g 1 , . . . , g w are independent and uniform on G, Phipson and Smyth also provide a formula for P H p (− B ≥ − b), under Condition 1. The formula (B + 1)/(w + 1) simplifies to the formula B/w if the identity map is added to the random permutations. It follows that the permutation test based on random permutations becomes exact for certain α if the identity is added. Note that this only holds if Condition 1 is satisfied and all permutations are from distinct equivalence classes G i .
We now state some additional results that follow from Sect. 3.3. Corresponding to the randomized test of Proposition 3, a randomized p value can be defined as follows. The advantage of this p value is that it is always uniform on [0, 1] under H p without requirement of additional assumptions, and it is easy to compute. Consider the randomized test of Proposition 3 (hence with G as in Definition 2). Suppose without loss of generality that when T (X ) = T (k ) , the test rejects if and only if a > u, where u is uniform on [0, 1] and independent. Define the randomized p value by This p value has the property that p ≤ α if and only if the randomized test rejects. This implies in particular that p is exactly uniform on [0, 1] under H p . The fact that p is randomized is in itself not objectionable, since it is randomized anyway due to the random transformations.
A simple upper bound to p is a p value in the weak sense, which translates to (B + 1)/(w + 1) when g 1 , . . . , g w are for example all independent uniform draws from G. It is not exactly uniform on [0, 1] under H p . However, when w is large and there are few ties among the test statistics, it tends to closely approximate p , so that it may be used for simplicity.

Applications
We briefly mention some applications where our results are particularly useful. We have considered data X that lie in an arbitrary space X and an arbitrary group of transformations G. For example, we allow X to be a vector of functions, which is the type of data investigated by functional data analysis (FDA) (Cuevas 2014;Goia and Vieu 2016). Cox and Lee (2008) consider permutation testing with such functional data. To formulate an exact random permutation test in such a setting, the present paper is useful. In Hemerik and Goeman (2017), properties are proven of the popular method SAM ("Significance Analysis of Microarrays", Tusher et al. 2001). This is a permutationbased multiple testing method which provides an estimate of the false discovery proportion, the fraction of false positives among the rejected hypotheses. Using Theorem 2, Hemerik and Goeman (2017) showed for the first time how a confidence interval can be constructed around this estimate.
In a basic permutation test, the observed statistic T (X ) is compared to T (k) ∈ R, a quantile of the permutation distribution. The permutation-based multiple testing method by Meinshausen (2006), which provides simultaneous confidence bounds for the false discovery proportion, also constructs a quantile based on the permutation distribution. There, however, l ∈ N hypotheses and hence l statistics T 1 (X ), . . . ., T l (X ), are considered. (They consider p values as test statistics.) Correspondingly, the quantile which Meinshausen constructs is l-dimensional. It turns out that the crucial step of the proof (the second last line of the proof, p. 231) relies on the principle behind the basic permutation test. The present article can be used to make this method exact. (For example, in Meinshausen (2006), id should be added to the random permutations.) In Goeman and Solari (2011), it is suggested to combine the method by Meinshausen (2006) with closed testing, which leads to a very computationally intensive method. Hence, preferably only a limited number of permutations (e.g. 100) would be used. The present paper allows using such a limited number of transformations, while still obtaining an exact method.

Discussion
This paper proves properties of tests with random permutations in a very general setting. Properties such as unbiasedness of tests of composite null hypotheses and consistency do not hold in general, but may be proved for more specific scenarios. For fixed permutations, there are many results regarding such properties (Hoeffding 1952;Lehmann and Romano 2005;Pesarin andSalmaso 2010, 2013) which may be extended to random permutations.
Aside from the permutation test, there are many multiple testing methods which employ permutations, some of which are mentioned in Sect. 4. Another example is the maxT method by Westfall and Young (1993). These methods are precisely based on the principle behind the permutation test. This paper can provide better insight into these procedures, when random permutations are used.