0

I have performed non-metric multidimensional scaling (NMDS) on two data frames, each containing different variables but for the same sites. I am using the vegan package:

> head (ResponsesS3)
   R1_S3 R10_S3 R11_S3 R12_S3 R2_S3 R3_S3 R4_S3 R6_S3 R7_S3 R8_S3 R9_S3
4      0      0      0      0     0     1     0     0     0     0     0
5      0      0      0      0     0     1     0     0     0     0     0
7      1      0      0      1     0     0     0     0     0     0     0
12     0      0      0      0     0     1     0     0     0     0     0
14     2      2      0      0     0     0     2     0     0     0     0
16     0      0      1      0     0     0     0     0     0     1     0


> head (EnvtS3)
     Dep_Mark  Dep_Work   Dep_Ext   Use_For Use_Fish    Use_Ag Div_Prod
4  0.06222836 1.0852315 0.8367309 1.1415929 1.644670 0.1006964 0.566474
5  0.25946808 1.3342266 0.0000000 1.7123894 0.822335 0.0000000 0.283237
7  2.20668862 0.0000000 0.8769881 0.4280973 0.822335 0.5244603 0.849711
12 2.26323697 0.0000000 0.8090991 1.1415929 0.000000 1.4957609 1.416185
14 1.65107675 0.5195901 0.2921132 0.5707965 0.822335 1.7873609 0.849711
16 1.82230225 0.4760163 0.1915366 2.2831858 0.000000 1.6614904 0.849711


> ResponsesS3.mds = metaMDS (ResponsesS3, k =2, trymax = 100)

> EnvtS3.mds = metaMDS (EnvtS3, k =2, trymax = 100)

I fit the results using a procrustean superimposition

> pro.ResponsesS3.EnvtS3.mds <- procrustes(ResponsesS3.mds,EnvtS3.mds)

I am most interested in understanding how the variables from each dataset fit together. I would like to use the plot() function to return a graph of the variables from ResponsesS3 and from EnvtS3, rather than the sites (which is what the plot function returns by default).

Is this possible?

Sky
  • 93
  • 2
  • 5

2 Answers2

0

No, this is not possible. The problem you'll find you have is that there will be different numbers of variables in the two datasets which causes the procrustes() method to fail if you try procrustes(..., scores = "species").

Even if you fit with procrustes(..., score = "sites") (the default), who do you propose to draw the plot if we could extract the species information? The current plot joins rows from one matric with the rows of other; this works in the default setting because the datasets are assumed to be measurements on the same locations/sites. But this is not possible with species/variables. More fundamentally, how should we pair up species with environmental variables?

Finally, you are trying to look at how the variables compare yet have used a method that essentially throws this information away once dissimilarities are computed.

I would look at the method of coinertia analysis, of which there is a crude interface in my cocorresp package and a fuller one in the ade4 package. If you find yourself wanting to compare two sets of species data, try cocorrespondence analysis, which cocorresp fits.

Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
0

Like Gav said, the points must match each other one to one for Procrustes rotation. However, once you have a Procrustes rotation, you can naturally apply it to other matrices with the same number of columns. The number of columns is crucial: If you have 2-dim NMDS, your variables also must be mapped into these 2 dim. Function metaMDS() will get you such column scores corresponding to your ordination of row scores, but I don't know how adequate these are in your case. The easiest way to rotate those scores in vegan is to use predict method with newdata. Continuing with your example:

predict(pro.ResponsesS3.EnvtS3.mds, newdata=scores(EnvtS3.mds, "species"))

This will only rotate your column scores ("species") similarly as is rotated your row scores.

We do not know what you try to achieve, and indeed there may be better ways to achieve your goal (check Gavin's answer for a starter). However, this will do the rotation.

Jari Oksanen
  • 3,287
  • 1
  • 11
  • 15