0
$\begingroup$

This question has been discussed before but the proposed solution (https://stats.stackexchange.com/a/459820/170801) is no longer reproducible for some reason. As a refresher - it has been suggested that turning off the autotransform and halfchange options in veganMDS() will allow you to produce identical results whether you are directly entering a community data matrix or distance matrix of it:

library('vegan')
data(varespec)

dij <- vegdist(varespec, method = 'bray')

set.seed(1)
ord1 <- metaMDS(varespec, distance = 'bray', k = 2)
set.seed(1)
ord2 <- metaMDS(dij, k = 2)
set.seed(1)
ord3 <- metaMDS(varespec, distance = 'bray', k = 2, autotransform = FALSE, 
                halfchange = FALSE)

However, when we run

all.equal(scores(ord2, 'sites'), scores(ord3, 'sites'))

it no longer produces:

[1] TRUE

as it did previously, but instead now produces:

[1] "Mean relative difference: 0.5965117"

Can anyone explain what's going on, please? Maybe https://stats.stackexchange.com/users/1390/gavin-simpson ?

$\endgroup$

1 Answer 1

1
$\begingroup$

In this case the sole reason seems to be that in your case model ord2 uses half-change scaling, but ord3 does not. This information is returned to you in the brief description of the result (i.e. with print):

> ord2  # prints a brief description of object ord2
...
Scaling: centring, PC rotation, halfchange scaling 

> ord3
...
Scaling: centring, PC rotation

You should not use all.equal to assess equality of scores from multivariate analysis: things like scaling and orientation of axes are in general undefined in NMDS. We do fix them with (half-change) scaling and PC rotation. However, direction of PC axes is undefined, and they can change sign. You should use Procrustes rotation to assess the similarity of configurations. This is provided by function vegan::procrustes. This would tell you that the configurations are equal:

> procrustes(ord2, ord3)

Call:
procrustes(X = ord2, Y = ord3) 

Procrustes sum of squares:
    0 

In this case this case differences in scaling are sufficient to explain the differences.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.