### We will be offering an R workshop December 18-20, 2019. Learn more.

# Amova

Analysis of molecular variance is a nonparametric analog of traditional analysis of variance. This method is widely used in population genetics to test the hypothesis that genetic diversity within two populations is not significantly different from that which would result from pooling the two populations (Excoffier et al., 1992; Anderson, 2001; Martin, 2002). The AMOVA statistic was calculated by

<math>SS_{within} = \frac{1}{n}\sum_{i=1}^{N-1} \sum_{j=i+1}^{N}{d_{ij}^2}\epsilon_{ij}</math>

<math>SS_{total}=\frac{1}{N}\sum_{i=1}^{N-1} \sum_{j=i+1}^{N}{d_{ij}^2}</math>

<math>SS_{among}=SS_{total}-SS_{within}</math>

<math>MS_{among}=\frac{SS_{among}}{a-1}</math>

<math>MS_{within}=\frac{SS_{within}}{N-a}</math>

<math>F_{statistic}=\frac{MS_{among}}{MS_{within}}</math>

where n is the number of samples per treatment (numSamples/numTreatments), a is the number of treatments, N is the number of samples, dij is the distance between samples i and j, and eij is 1 when i and j are from the same treatment and 0 when they are from different treatments. A P-value is calculated by measuring the fraction of 1000 randomizations of the rows and columns in a distance matrix where the observed SSW is less than or equal to the randomized SSW values.

To run the tutorial below please download the files and follow along...

## Default Settings

The phylip and design parameter are required. The phylip option allow you to enter your phylip formatted distance matrix. The design parameter allows you to assign your samples to groups when you are running amova. The design file is a simple tab-separated text file, with each line listing a sample ID (corresponding to entries in the distance matrix) and a group ID.

mothur > amova(phylip=amazon.dist, design=amazon.design)

opening the amazon.amova file you will see:

A-B Among Within Total SS 0.04869 4.72878 4.77747 df 1 96 97 MS 0.04869 0.0492581 Fs: 0.988466 p-value: 0.44

## Options

### alpha

The default for the alpha parameter is 0.05.

### iters

The default for iters is 1000.

### sets

The sets parameter allows you to specify which of the sets in your design file you would like to analyze. The set names are separated by dashes. The default is all sets in the designfile.

## Revisions

- 1.28.0 Added sets parameter - http://www.mothur.org/forum/viewtopic.php?f=3&t=1777