vegandevs / vegan

R package for community ecologists: popular ordination methods, ecological null models & diversity analysis
https://vegandevs.github.io/vegan/
GNU General Public License v2.0
454 stars 98 forks source link

metaMDS inertia explained #309

Closed shengzizhang closed 5 years ago

shengzizhang commented 5 years ago

Hi guys, I saw some literature to have metaMDS analysis and showed percent variance to be explained by NMDS1 and NMDS2, similar to PCA. I wonder how to calculate them in VEGAN.

KasperSkytte commented 5 years ago

nMDS is not an eigenanalysis based method, so that should not be possible. Please link the reference

shengzizhang commented 5 years ago

Here is one erference: https://www.ncbi.nlm.nih.gov/pubmed/30862608

KasperSkytte commented 5 years ago

It seems to me like the authors in the study must have confused metric Multidimensional Scaling (MDS or mMDS) aka Principal Coordinates Analysis (PCoA) with NON-metric Multidimensional Scaling (nMDS). When using the PCoA/mMDS method a percentage of each axis' contribution to the total inertia (its eigenvalue relative to the total sum of eigenvalues) is often indicated at the axis titles expressing the amount of variation each axis shows of the data and must be as high as possible. nMDS on the other hand is a completely different algorithm. It has a single stress (or strain if Torgerson method) value instead that expresses the "succes" of the nMDS solution as a whole, and must be as low as possible. You should instead note the stress value in the corner of the plot or somewhere in the text.

shengzizhang commented 5 years ago

Thanks for the explanation. Is there a range or cutoff for the stress value that could claim the data is reasonably separated?

eduardszoecs commented 5 years ago

See :

J. B. Kruskal. Multidimensional scaling by optimizing goodness of fit to a nonmetric hypothesis. In: Psychometrika, 29(1), 1964, S. 1–27

But if that's useful? I

KasperSkytte commented 5 years ago

See https://mb3is.megx.net/gustame/dissimilarity-based-methods/nmds for a general introduction to nMDS. I would say 0.20 is absolute max, 0.15 or below is ideal.

jarioksa commented 5 years ago

The medical paper that @shengzizhang suggested as a reference was behind a paywall, and I could only check its contents today. Contrary to @KasperSkytte , the authors claim that they used NMDS with vegan::metaMDS(). I have no idea how they calculated the percentages for axes, though. They have given their analysis runs in the Supplementary Material part 3 of their paper, but this does not help here: the percentages are hard-coded in the axis titles with little indication how they found them (no preceding command gives that information). However, I am absolutely baffled with the way they analysed their data and I really do not understand what they have done. Don't copy their procedures for your own data unless you really think you know what you are doing.

jarioksa commented 5 years ago

I second the guidelines that @KasperSkytte gave to stress values. The community data are generally noisy, and 0.2 often is OK. Random configurations typically have stress of 0.4 in 2D. However, these threshold values depend on the number of dimensions, and in 3D ordinations all values are lower – including stress for a random configuration. Further, if you get very low stress values, you probably have problems with your data. Values below 0.05 are suspect, and currently metaMDS() issues a warning if stress is close to zero.