Skip to content
Prev 2796 / 7420 Next

non-metric MDS comparison - vegan vs. ecodist packages

On 20/02/2012, at 22:01 PM, Gavin Simpson wrote:

            
Unfortunately reading the code is not always quite easy in R, but you have to decipher the logic of the whole function instead of single easy pieces. The inline function sstress() gives the formula, but you have to read further down to see what are the actual variables used in sstress(). If you do so, you see that the ecodist::nmds stress is defined as:

sum((dmat - dist)^2)/sum(dmat^2)

where 'dmat' are the input dissimilarities and 'dist' are the distances among points in the ordination configuration.

This is *not* Kruskal's stress, at least not like he defined it in his 1964 papers in Psychometrika. In vegan::monoMDS and in MASS::isoMDS Kruskal stress (stress=1 in vegan::monoMDS) we define squared stress as:

sum((dist-dhat)^2)/sum(dist^2)

where 'dhat' are the fitted distances from the monotone regression, and 'dist' the distances among points in ordination configuration (like above).  So the stresses do differ, and that is sufficient to explain the differences. 

Cheers, Jari Oksanen