[R] isoMDS and 0 distances

Tyler Smith tyler.smith at mail.mcgill.ca
Wed Apr 19 04:06:56 CEST 2006


I'm trying to do a non-metric multidimensional scaling using isoMDS. 
However, I have some '0' distances in my data, and I'm not sure how to 
deal with them. I'd rather not drop rows from the original data, as I am 
comparing several datasets (morphology and molecular data) for the same 
individuals, and it's interesting to see how much morphological 
variation can be associated with an identical genotype.

I've tried replacing the 0's with NA, but the isoMDS appears to stop on 
the first iteration and the stress does not improve:

distA # A dist object with 13695 elements, 4 of which == 0
cmdsA <- cmdscale(distA, k=2)

distB <- distA
distB[which(distB==0)] <- NA

isoA <- isoMDS(distB, cmdsA)
initial  value 21.835691
final  value 21.835691

The other approach I've tried is replacing the 0's with small numbers. 
In this case isoMDS does reduce the stress values.

[1] 0.02325581

distC <- distA
distC[which(distC==0)] <- 0.001
isoC <- isoMDS(distC)
initial  value 21.682854
iter   5 value 16.862093
iter  10 value 16.451800
final  value 16.339224

So my questions are: what am I doing wrong in the first example? Why 
does isoMDS converge without doing anything? Is replacing the 0's with 
small numbers an appropriate alternative?

Thanks for your time,

R 2.2.1

More information about the R-help mailing list