1. Home
  2. ECANOSIM procedure

ECANOSIM procedure

Performs an analysis of similarities i.e. ANOSIM (D.A. Murray).


PRINT = string token Controls printed output (test); default test
PLOT = string token Type of plot (boxplot, histogram); default hist
NTIMES = scalar Number of permutations to make; default 999
BLOCKS = factor Factor specifying groups for a stratified test; default * i.e. none
SEED = scalar Seed for the random number generator used to make the permutations; default 0 continues from the previous generation or (if none) initializes the seed automatically


DATA = symmetric matrices Similarity matrix
GROUPS = factors Specify the different groups for each matrix
STATISTIC = scalars Save the R statistics
PROBABILITY = scalars Save the probabilities


Analysis of similarities (ANOSIM) is a nonparametric method to test whether there is a significant difference between two or more groups of sampling units (Clarke 1993). The method performs a permutation test based on the ranks of measures of similarity between sampling units. The data should be supplied as a similarity matrix using the DATA parameter. The GROUPS parameter specifies a factor containing the groups for each corresponding row of the similarity matrix.

The ANOSIM statistic R is calculated by the difference of the between-group (rb) and within-group (rw) mean rank similarities:

R = (mean(rb) – mean(rw)) / (n × (n – 1) / 4)

The denominator is chosen so the R lies in the range (-1, 1) where 0 represents no difference between the groups. The similarites are ranked where a rank of 1 corresponds to the highest similarity.

The statistical significance of the R statistic is assessed by a permutation test. ECANOSIM performs 999 random permutations (made using a default seed), and calculates the R statistic for each permutation. The probability for the R statistic is then determined from its distribution over the randomly permuted datasets. The NTIMES option of ECANOSIM allows you to request another number of permutations, and the SEED option allows you to specify another seed. For designs with no blocking ECANOSIM checks whether NTIMES is greater than the number of possible permutations available for the data set. If so, ECANOSIM does an exact test instead, which uses each possible permutation once.

The histogram setting of the PLOT option can be used to produce a distribution of the R values. ANOSIM assumes under the null hypothesis that distances within groups are smaller than those between groups, and that the ranked dissimilarities within groups have equal median and range. The boxplot setting for the PLOT option can be used to help check these assumptions.

The R statistic can be saved using the STATISTIC parameter, and the probability can be saved using the PROBABILITY parameter.

The PRINT option controls printed output, with a setting:

    test to print the R statistic and probability.




The R statistic is calculated by:

R = (mean(rb) – mean(rw)) / (n × (n – 1) / 4)

where mean(rw) is the average of all rank similarities among replicates within sites, mean(rb) is the average of rank similarities from all pairs of replicates between sites and n is total number of samples.

Action with RESTRICT

The data must not be restricted.


Clarke K,R. (1993). Non-parametric multivariate analyses of changes in community structure. Australian Journal of Biology, 18, 117-143.

See also

Procedure: MANTEL.

Commands for Ecological data.


CAPTION     'ECANOSIM Example'; style=meta
FACTOR      [LEVELS=5; VALUES=1,1,1,2,2,2,3,3,3,4,5,5,5,5] groups
VARIATE     [NVALUES=14] data[1...5]; VALUES=!(5(1),9(0)),\
ECANOSIM    [SEED=10416] sim; GROUPS=groups
Updated on June 19, 2019

Was this article helpful?