2
$\begingroup$

The dataset is ecological (species abundance), where I am calculating distances between 51 sampling sites, based on abundances of 3200 species. The species abundance values go up to 2700, and the rest of the abundance matrix is pretty sparse with many zeros.

I am calculating distance matrices using the vegan package in R, like this:

dist.jac <- vegan::distance(abund, method="jaccard")

dist.bray <- vegan::distance(abund, method="bray")

Mantel test says they are nearly the same.

Moreover, once ordinated using NMDS, the Procrustes test reports absolute identity (t=1, p<0.0001).

Does that say anything about my data structure? Should I be concerned?

$\endgroup$
  • $\begingroup$ To notice. I'm not sure if your data is binary (dichotomous), but for binary data BC distance = 1-Dice, which is in turn 2a/(2a+b+c) - not far from Jaccard a/(a+b+c). Given that NMDS reacts only to monotonic relationships in dissimilarities, I wouldn't wonder if someone gets identical results (at least sometimes?) $\endgroup$ – ttnphns Oct 24 '16 at 20:05
  • $\begingroup$ Thanks for the comment, ttnphns! But the data are not binary. That's what's puzzling! All sites were sampled with equal depth, and species abundances are counts, ranging from 0 to about 2700. $\endgroup$ – willnotburn Oct 24 '16 at 20:54
1
$\begingroup$

Got it! The issue is not with the data but the vegan package in R.

In the package, the syntax for calculating the Jaccard distance matrix must include the explicit argument that the species abundance input is binary.

If the input abundance table is not binary and the binary=TRUE argument is absent, the calculation switches to an "extended Jaccard", which is computed as

$$\frac{2B}{1 + B}$$

where $B$ is Bray–Curtis dissimilarity, resulting in a matrix very similar to a Bray-Curtis.

With the binary=TRUE argument in place, the Jaccard matrix is only 75% similar to Bray-Curtis. It is also 100% similar to a Jaccard matrix I calculated using a different R package ecodist.

dist.jac <- vegan::distance(abund, method="jaccard", binary=TRUE)
dist.bray <- vegan::distance(abund, method="bray")

Many downstream R packages that are used to process and visualize microbial data rely on vegan, but the convenience functions often do not include detailed documentation for the dependencies.

The Jaccard issue is brought up in a forum for one of my favorite microbial packages phyloseq https://github.com/joey711/phyloseq/issues/572, which I used to observe this particular conundrum that wasn't.

$\endgroup$
  • $\begingroup$ Hi @willnotburn. The issue was brought on the vegan's github repository as well, by the same person. $\endgroup$ – Valentin Apr 20 '17 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.