Analysis of similarities (ANOSIM) is a non-parametric statistical test widely used in the field of ecology.
The test statistic R is calculated in the following way: where rB is the average of rank similarities of pairs of samples (or replicates) originating from different sites, rW is the average of rank similarity of pairs among replicates within sites, and M = n(n − 1)/2 where n is the number of samples.
For the purpose of hypothesis testing, where the null hypothesis is that the similarities within sites are smaller or equal to the similarities between sites, the R statistic is usually compared to a set of R′ values that are achieved by means of randomly shuffling site labels between the samples and calculating the resulting R′, repeated many times.
Combining both methods complement visualisation of group differences along with significance testing.
[2] ANOSIM is implemented in several statistical software including PRIMER, the R Vegan package [3] and PAST.