[R-sig-eco] Simpson dissimilarity in NMDS

Gavin Simpson gavin.simpson at ucl.ac.uk
Thu Oct 21 15:44:21 CEST 2010


On Thu, 2010-10-21 at 06:11 -0700, o paknia wrote:
> Dear all,
> I am trying to use Simpson dissimilarity measure (in Koelf et al 2003 JAE, as 
> Beta Sim) to perform Nonmetric Multidimensional Scaling. 
> 
> First by making a dissimilarity matrix:
> 
> dis.mat <-betadiver(fine.scale, index = 22)
> dis.mat<-as.matrix(dis.mat)
> 
> then using this matrix in meta MDS:
> nms<-metaMDS(dis.mat,trymax=100,zerodist="add")
> 
> but I get this error:
> 
> Error in isoMDS(dist, k = k, trace = isotrace) : zero or negative distance 
> between objects 5 and 6
> 
> checking my matrix, there is neither negative value or zero in my matrix.
> So I am confused, where I am doing wrong.

Without any evidence to the contrary (more than your say so) I suggest
you are mistaken in your belief that you don't have 0 or negative
distances. I cannot reproduce what you claim, but I reproduce the error
using the inbuilt data 'varespec'

> data(varespec)
> dist.mat <- betadiver(varespec, index = 22)
> nms <- metaMDS(dist.mat,trymax=100,zerodist="add")
Error in isoMDS(dist, k = k, trace = isotrace) : 
  zero or negative distance between objects 2 and 21
> dist.mat[c(2,21), c(2,21)]
   15 12
15  0  0
12  0  0

So try (using your objects):

dis.mat[c(5,6), c(5,6)]

and see what it returns? If it shows that these are not zero, then could
you send your data to me off list and then I can step through metaMDS to
see what is happening? I promise to delete it after tracking down the
problem and not to use it for anything other than working out what the
error is.

Notice also that zerodist = "add" won't do anything as you have supplied
metaMDS with the dissimilarities. 'zerodist' is an argument to
metaMDSdist() and as ?metaMDS tells you all steps are skipped other than
random starts and centring and PC rotation of "axes", including
zerodist. If you do have zero dissimilarities, you'll have to sort out
adding the required value or deleting the duplicate samples to get
metaMDS to work.

HTH

G

> 
> Thank you very much for creating time and giving any hint.
> Kind regards,
> Omid
> 
>  
> 
> 
> 
> 
>  Omid Paknia,
> Institute of Experimental Ecology,
> Albert-Einstein-Allee 11 
> University of Ulm
> D-89069 Ulm, 
> Germany
> http://www.uni-ulm.de/nawi/bio3/kalko/phdstud/paknia.html
> 
> 
> 
>       
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-sig-ecology mailing list