[R] isoMDS

Jari Oksanen jarioksa at sun3.oulu.fi
Thu Sep 9 10:26:30 CEST 2004

On Wed, 2004-09-08 at 21:31, Doran, Harold wrote:
> Thank you. Quick clarification. isoMDS only works with dissimilarities.
> Converting my similarity matrix into the dissimilarity matrix is done as
> (from an email I found on the archives)
> > d<- max(tt)-tt
> Where tt is the similarity matrix. With this, I tried isoMDS as follows:
> > tt.mds<-isoMDS(d)
> and I get the following error message. 
> Error in isoMDS(d) : An initial configuration must be supplied with
> NA/Infs in d. I was a little confused on exactly how to specify this
> initial config. So, from here I ran cmdscale on d as
This error message is quite informative: you have either missing or
non-finite entries in your data. The only surprising thing here is that
cmdscale works: it should fail, too. Are you sure that you haven't done
anything with your data matrix in between, like changed it from matrix
to a dist object? If the Inf/NaN/NA values are on the diagonal, they
will magically disappear with as.dist. Anyway, if you're able to get a
metric scaling result, you can manually feed that into isoMDS for the
initial configuration, and  avoid the check. See ?isoMDS.

> > d.mds<-cmdscale(d)
> which seemed to work fine and produce reasonable results. I was able to
> take the coordinates and run them through a k-means cluster and the
> results seemed to correctly match the grouping structure I created for
> this sample analysis.
> Cmdscale is for metric scaling, but it seemed to produce the results
> correctly. 
> So, did I correctly convert the similarity matrix to the dissimilarity
> matrix? Second, should I have used cmdscale rather than isoMDS as I have
> done? Or, is there a way to specify the initial configuration that I
> have not done correctly.

If you don't know whether you should use isoMDS or cmdscale, you
probably should use cmdscale. If you know, things are different.
Probably isoMDS gives you `better'(TM) results, but it is more
complicated to handle.

cheers, jari oksanen
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
Ph. +358 8 5531526, cell +358 40 5136529, fax +358 8 5531061
email jari.oksanen at oulu.fi, homepage http://cc.oulu.fi/~jarioksa/

More information about the R-help mailing list