## R 1028

where rB is the mean of the ranks in the between-group submatrix (i.e. the rectangle, in Fig. 10.22a, crossing groups 1 and 2), rW is the mean of the ranks in all within-group submatrices (i.e. the two triangles in the Figure), and n is the total number of objects. In the present example, rB = 7.083 and rW = 3.125, so that R = 0.79167 (eq. 10.28).

Using ranks instead of the original distances is not a fundamental requirement of the method. It comes from a (reasonable) recommendation, by Clarke and co-authors, that the test statistic should reflect the patterns formed among sites represented by Permutation multidimensional scaling plots (MDS, Section 9.3), which preserve ranktest transformations of distances. The R statistic is tested by permutations of the objects, as explained in Box 10.2. The denominator of eq. 10.28 is chosen in such a way that R = 1 if all the lowest ranks are in the "within-group" submatrices, and R = 0 if the high and low ranks are perfectly mixed across the "within" and "between" submatrices. R is unlikely to be substantially smaller than 0; this would indicate that the similarities within groups are systematically lower than among groups.

Clarke (1988, 1993) actually applied the method to the analysis of several groups. This is also the case in the nonparametric ANOVA-like example of the Mantel test proposed by Sokal & Rohlf (1995). The statistic (eq. 10.28) can readily handle the more-than-two-group case: rB is then the mean of the ranks in all between-group submatrices, whereas rW is the mean of the ranks in all within-group submatrices.

Both Anosim and the goodness-of-fit Mantel test (Fig. 10.20) assume that, if H0 is false, distances within all distinct groups are comparable in that they are smaller than the among-group distances. This should be checked before proceeding with Anosim. Strong heteroscedasticity among groups (i.e. the presence of dense and more dispersed groups) may actually violate this condition and increase the type I error of the test. In other words, the Mantel or Anosim tests may find significant differences among groups of objects exhibiting different dispersions, even if they come from statistical populations having identical centroids; see the footnote in Subsection 1.2.2 about the Behrens-Fisher problem.

Equation 10.28 may be reformulated as a Mantel cross-product statistic zm (Box 10.2). To achieve this, define a model matrix containing positive constants in the "between-group" portion and negative constants in the "within-group" parts:

• the "between" values (shaded area in Fig. 10.22b) are chosen to be the inverse of the number of between-group distances (1/6 in this example), divided by the denominator of eq. 10.28, i.e. [n(n - 1)/4] (which is 5 in the present example);

• similarly, the "within" values in Fig. 10.22b are chosen to be the inverse, with negative signs, of the number of distances in all within-group submatrices (-1/4 in the example), also divided by [n(n - 1)/4] (= 5 in the present example).

The coding is such that the sum of values in the half-matrix is zero. The unstandardized Mantel statistic (Box 10.2), computed between matrices X and Y of Fig. 10.22, is zm = 0.79167. This result is identical to Clarke's Anosim statistic.

Since the permutation method is the same in the Mantel and Anosim procedures, the tests should produce similar probabilities. They may differ slightly in practice because different programs, and even different runs of the same program, may produce different sequences of permutations of the objects. Actually, Subsection 10.5.1 has shown that any binary coding of the "within" and "between" submatrices of the model matrix should lead to the same probabilities. of course, interchanging the small and large values produces a change of sign of the statistic and turns an upper-tail test into a lower-tail test. The only substantial difference between the Mantel goodness-of-fit and

Anosim tests is one of tradition: Clarke (1988, 1993) and the Primer package (Clarke & Warwick, 1994) transform the distances into ranks before computing eq. 10.28. Since Clarke's R is equivalent to a Mantel statistic computed on ranked distances, it is thus analogous to a Spearman correlation coefficient (eqs. 5.1 and 5.3).

Mann-Whitney's U statistic could also be used for analysis-of-variance-like tests of significance performed on distance matrices. This has been suggested by Gordon (1994) in a different context, i.e. as a way of measuring the differentiation of clusters produced by clustering procedures (internal validation criterion), as reported in Section 8.12. In Gordon's method, distances are divided in two subsets, i.e. the within-group (W) and between-group (B) distances — just like in Clarke's method. A U statistic is computed between the two subsets. U is closely related to the Spearman rank correlation coefficient (eqs. 5.1 and 5.3); a U test of a variable against a dummy variable representing a classification in two groups is equivalent to a Spearman correlation test (same probability). Since Clarke's statistic is also equivalent to a Spearman correlation coefficient, the Mann-Whitney U statistic should lead to the exact same probability as the Clarke or Mantel statistics, if U was used as the statistic in a Mantel-like permutation test. [Using the U statistic as an internal validation criterion, as proposed by Gordon (1994), is different. on the one hand, the grouping of data into clusters is obtained from the distance matrix which is also used for testing; this is not authorized in an analysis-of-variance approach. On the other hand, Gordon's Monte Carlo testing procedure differs from the Mantel permutation test.]