Question: Different calculation of Bray-Curtis dissimilarity in vegan (R) and mothur?
0
songzewei0 wrote:

The Bray-Curtis dissimilarity using vegdist of the vegan package in R is calculated as the sum of absolute difference between each pair of OTU:

 bray d[jk] = (sum abs(x[ij]-x[ik]))/(sum (x[ij]+x[ik])) binary: (A+B-2*J)/(A+B)

But this is different from what is described in mothur (http://www.mothur.org/wiki/Braycurtis ), and wiki (http://en.wikipedia.org/wiki/Bray%E2%80%93Curtis_dissimilarity ), which use the sum of minimum abundance of each pair of OTU. Are they the same mathematically?

Thanks!

modified 2.9 years ago by ingra_sg0 • written 4.1 years ago by songzewei0
6
pschloss290 wrote:

Mathematically they're the same and give the same answer. For example...

forest <- c(1, 1, 1, 1, 1, 1, 3, 3, 2, 2, 1, 1, 3, 2, 1, 1, 1, 1, 2, 1, 1, 2, 5, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

pasture <- c(0, 0, 0, 1, 1, 0, 1, 0, 0, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1, 1, 1, 1, 7, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1)

1-2*sum(pmin(forest, pasture))/(sum(forest) + sum(pasture))
vegdist(rbind(forest, pasture))

Both will give you 0.7551

0
ingra_sg0 wrote:

In this pdf_file http://www.econ.upf.edu/~michael/stanford/maeb5.pdf, you can find the correct formula´s notation used in vegdist implemented in vegan and their explanation of Bray-Curtis dissimilarity.