[R] Uses of isoMDS()

From: Ross Clement <R.P.Clement_at_westminster.ac.uk>
Date: Mon 06 Jun 2005 - 23:28:29 EST

Hi. I'm using the isoMDS() function of the MASS library for multidimensional scaling. I have two questions that I have not been able to solve by searching through the archives.

(i) What is the exact stress measure used? The text in the help file
says:

     This chooses a k-dimensional (default k = 2) configuration to
     minimize the stress, the square root of the ratio of the sum of
     squared differences between the input distances and those of the
     configuration to the sum of configuration distances squared.
     However, the input distances are allowed a monotonic
     transformation.

I presume that this is Stress-1 from Kruskal's 1964 paper "Multidimensional scaling by optimising goodness of fit to nonmetric hypothesis". (I haven't got a copy of this paper but have Borg and Groenen's book which references it). However, I'm not 100% sure given the text description in the help file, and note that isoMDS() quotes stress as a percentage.

As a preparation for using MDS I wrote some MDS code using iterative majorisation. While I'm sure that isoMDS() produces much better results, I would still like to do a like-for-like comparison. If I use a straight correlation measure between the original and recreated distances, then isoMDS() is considerably (typically about 0.05) better than my program, but I'd like to have the proper stress comparison.

(ii) I write most of my code in C. I haven't been able to pin down
exactly what the status of linking C to R is. At present I do the following:

  if ( experiment == MDS )
  {
    writeDistData( "temp.csv" );
    system( "R --no-save < rEuclidean.R >> /dev/null" );     reread( "temp.points" );
  }
  else if ( experiment == PCA )
  {
    writeRawData( "temp.csv" );

    system( "R --no-save < rEuclidean.pca.R >> /dev/null" );     reread( "temp.scores" );
  }

with appropriate R commands in the .R files.

This was easy to write, seems to work fine, and doesn't seem too slow. But, I'd still like to ask if there is a tidier way of achieving the same effect.

Thanks in anticipation,

Ross-c



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jun 06 19:25:05 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:22 EST