3

I have been doing some ordinations on a data set that I have of abundances of species at different sampling points. I am using metaMDS() in vegan to do this. With this function you can either:

  1. enter directly the community data (sites in rows and species in columns) and specify what type of distance you want it to use (i.e. jaccard, brays curtis, euclidean, etc.) and the function calls vegdist() to do this.

On the other hand you can

  1. give the metaMDS a distance matrix you have already created, potentially using vegdist() (separate from the metaMDS() function).

Where I am confused is that if I do the first strategy I get one answer, and when I do the second (and then putting that distance matrix into the metaMDS() function) I get a totally different answer (very different stress values, different ordination coordinates). And when I call for the distance matrix created in the first strategy the distances are drastically different then what I get from just vegdist() function. I read in passing, researching something else, that when metaMDS() calls the vegdist() function it is finding the distances in multi-dimensional space, while just using vegdist() is in a single dimension.

Essentially I am asking is how does metaMDS() call and compute the distances with vegdist() (is it doing it in multi-dimensional space?) and how is that different than simply using vegdist() itself? Hopefully in understanding these differences I can discern which is the best and most appropriate method for my dataset.

    mrja<-read.table("example.txt")
    jac<-vegdist(mrja,method="jaccard")
    head(jac)
[1] 0.7910448 0.8721461 0.7157360 0.9075908 0.9335038 0.9104478 ###first six distances
    
    ordjac1<-metaMDS(jac,k=2)
    ordjac1$stress
[1] 0.169781
    ordjac1

Call:
metaMDS(comm = jac, k = 2) 

global Multidimensional Scaling using monoMDS

Data:     jac 
Distance: jaccard 

Dimensions: 2 
Stress:     0.169781 
Stress type 1, weak ties
No convergent solutions - best solution after 20 tries
Scaling: centring, PC rotation 
Species: scores missing

    ordjac2<-metaMDS(mrja,k=2,distance="jaccard")
    ordjac2$stress
[1] 0.2367037
    
    head(ordjac2$dist)
[1] 5.259303e-06 2.812693e-05 1.879357e-02 1.216611e-01 3.913638e-02
[6] 7.444730e-02   ###first six distances

    ordjac2

Call:
metaMDS(comm = mrja, distance = "jaccard", k = 2) 

global Multidimensional Scaling using monoMDS

Data:     wisconsin(sqrt(mrja)) 
Distance: jaccard 

Dimensions: 2 
Stress:     0.2367037 
Stress type 1, weak ties
No convergent solutions - best solution after 20 tries
Scaling: centring, PC rotation, halfchange scaling 
Species: expanded scores based on ‘wisconsin(sqrt(mrja))’
Werner Hertzog
  • 2,002
  • 3
  • 24
  • 36
Caitlyn_D
  • 33
  • 1
  • 6
  • 1
    How do you know that either of these converged to a good solution? All you've shown is that two different runs of a NMDS converged to two different solutions. – Gavin Simpson Sep 02 '14 at 18:30

1 Answers1

4

There is not sufficient information, but perhaps metaMDS performed some transformation and standardization. This is seen in tracing information and in printed output. For instance, we have

> metaMDS(varespec)
Square root transformation
Wisconsin double standardization
...
global Multidimensional Scaling using monoMDS

Data:     wisconsin(sqrt(varespec)) 
Distance: bray 

which tells you that data were first squareroot transformed and then Wisconsin standardized. Do you see something like this? You can turn off these by setting argument autotransform = FALSE in the metaMDS() call. You can start by providing us this information.

Jari Oksanen
  • 3,287
  • 1
  • 11
  • 15
  • It seems that you're looking at internal structures of the `monoMDS` results. These are undocumented, and you should understand what you look at. `ordjac2$dist` contains distances among points in the ordination space; the original dissimilarities are in `ordjac2$diss`. Neither of these are in the original order, but their indices are `ordjac2$iidx` and `ordjac2$jidx`. If you order by these, you get the input dissimilarities. – Jari Oksanen Sep 03 '14 at 14:17
  • I just added the call for both of those runs and I think I now understand. The first thing I was originally confused about the ordjac$dist, which was simply that I thought it give me the Jaccards index not the ordination distance. The second and more important is that I now understand why I was getting different results. I didn't know that it was transforming the distance matrix first. That is exactly what I needed to know. Thank you very much. – Caitlyn_D Sep 03 '14 at 20:23