[R] Plotting MDS (multidimensional scaling)

Daniel Malter daniel at umd.edu
Sat Apr 2 22:07:35 CEST 2011


I just encountered what I thought was strange behavior in MDS. However, it
turned out that the mistake was mine. The lesson learned from my mistake is
that one should plot on a square pane when plotting results of an MDS. Not
doing so can be very misleading. Follow the example of an equilateral
triangle below to see what I mean. I hope this helps others to avoid this
kind of headache.

Let's say I have an equilateral triangle. Then, the three Euclidean
distances between points A, B, and C  are all equal. That is,
dist(AB)=dist(AC)=dist(BC). Let the points A, B, and C have
(x,y)-coordinates  (0,0), (2,0), and (1,sqrt(3)). Then, MDS should reproduce
an equilateral triangle, which it does if there are only three points. 

plot(fit1$points, xlab="Coordinate 1", ylab="Coordinate 2", 
  main="Metric MDS",type="n")
text(fit1$points, labels = c('A','B','C'), cex=1)

So far so good, until I add more points. Now assume, I add a fourth point D
at {0,2*sqrt(3)}. This produces the rectangular triangle ABD with
hypothenuse BD that encompasses the smaller triangle ABC such that C lies in
the middle between B and D. Then, MDS should reproduce the rectangular
triangle ABD and the equilateral triangle ABC within it. However, even
though distance matrix d2 below still indicates that ABC is an equilateral
triangle, the plot of the MDS does not confirm this.

plot(fit2$points, xlab="Coordinate 1", ylab="Coordinate 2", 
  main="Metric MDS",type="n")
text(fit2$points, labels = c('A','B','C','D'), cex=1)

The reason for this is that the dimension of the plot is automatically
scaled to fit the points. This distorts the visual impression of the
distances, angular relationships, and relative locations. If you plot on a
square pane, however, peace and order are restored in the galaxy.

plot(fit2$points, xlab="Coordinate 1", ylab="Coordinate 2", 
  main="Metric MDS",type="n",xlim=c(-3,3),ylim=c(-3,3))
text(fit2$points, labels = c('A','B','C','D'), cex=1)


View this message in context: http://r.789695.n4.nabble.com/Plotting-MDS-multidimensional-scaling-tp3422670p3422670.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list