%variance in NMDS and R

25 views
Skip to first unread message

David McNear

unread,
Feb 20, 2025, 3:16:09 PMFeb 20
to PC-ORD
Hi Bruce, 

in a study we are using a mix of R (student) and PC-ORD (me) to perform NMDS, MRPP, etc. using microbial community data from an incubation study to investigate the fate of carbon  from roots of different plant species.  The mix of R and PC-ORD has led to some questions. 

1. PC-ORD offers the possibility to generate 'after-the-fact' axis scores representing the % variance of the NMDS ordination axis for the orientation shown.  According to your book, this is done by comparing how well the distances between points in the ordination diagram represent distances in the original, unreduced space.  Is there a formula for this?  I ask because the 'vegan' and 'labdsv' package in R used to perform the NMDS doesn't seem to have the ability to generate the scores. If I have the method we may be able to code it in.  Unless you know of some R code out there to do this.

2. There seems to be a general pushback against calculating/reporting axis variance for NMDS plots, which I get, but if you state "for the ordination shown" doesn't that make it ok?  

Thanks for your input.  



Bruce McCune

unread,
Feb 20, 2025, 6:01:06 PMFeb 20
to pc-...@googlegroups.com
David, Some details of this are explained in the built-in help system under NMS | Measures of fit (copied below, but I'm afraid the formatting won't copy well). In my view it is very useful to calculate % of variance for NMS axes, even though it is not "native" to NMS. I and my students have had no trouble publishing these statistics; most readers find them helpful. It is easy to calculate this, but also easiest to interpret if the NMS axes are first made orthogonal by principal axes rotation (the default in NMS autopilot in PC-ORD).

Note that vegan in R does report this (or at least used to, see below, metric fit) but only for the whole solution, not broken down by axes. To break it down by axes with a do-it-yourself  method: for example in a final 3D solution, calculate correlation between original distance matrix and Euclidean distance matrix for the axis 1 ordination space, repeat calculation of ED for axes 1+2 space, repeat for axes 1,2,3, then calculate the incremental and cumulative R2.

There are lots of things that vegan/R doesn't do that are very useful with NMS, for example the randomization test for Ho: stress is no lower than expected by chance alone. 6D to 1D step down solutions. etc.

Btw, people commonly apply post-analysis tools to help interpret the results with many different kinds of methods. For example, if you used a rank correlation between an external variable and scores on a PCA axis -- well, rank correlation has nothing to do with PCA, but that doesn't mean it isn't informative.

2. It's fine to include that phrase, but I would think that would be implicit anyway.

Bruce
--------------

Measures of Fit with NMS

Most users will be comfortable with the idea of using a proportion of variance represented as a measure of fit of an ordination to the data. For most ordinations there is a single measure of fit that is generally agreed upon. With NMS, however, there are several ways to express fit. By default, PC-ORD reports several measures of fit for NMS, so that you can use the form that makes most sense to you.

Definitions

S = scaled stress, 0-1 scale (in PC-ORD, stress formula 1 of Kruskal (1964a, b))

SR1 = √S  (square root of S)

SR100 = 100√S  (square root of S rescaled to 0-100)

Smin =   Minimum final stress, real data

S0 =   Average stress of initial configurations

Sp =   Average final stress after data have been permuted within columns (species)

r =  Pearson correlation coefficient

Dobs =  observed distances (e.g. in species space)

Dord =  ordination distances

Dmono =  distances after shifting points to monotonicity in Shepard plot

 

Names

Calculation

Null model

Notes

nonmetric fit

R2n = 1 – (SR1)2

All observations lie on same point (stress is maximal)

Intrinsic measure for NMS because it seeks to minimize stress (S)

"fit-based R2" and "linear fit" in function stressplot in vegan

R2l = [r(Dord, Dmono)]2

All ordination distances are equal (monotonic line is flat)

N-1 dimensions needed for null model of N points, so this null model is geometrically impossible in the ordination space (Oksanen 2013)

metric fit

R2m = [r(Dord, Dobs)]2

No linear relationship (slope = 0) between observed distances and ordination distances

Widely used but foreign criterion to NMS because NMS does not attempt to maximize this measure of fit. Allows partitioning of fit by axis. Is usually lower than nonmetric fit, although they tend to covary unless the Shepard plot is strongly nonlinear.

CHANCE-CORRECTED EVALUATIONS

(0 = random expectation, 1 = perfect fit, < 0 = worse than random expectation)

Improvement (from initial stress)

 

I = 1 - (Smin / S0)

Final configuration no better than initial random configuration

Compare lowest final stress with average stress from of a large number of random starting configurations, the coordinates assigned as uniform random variables.

Association (by shuffling within columns)

A = 1 – (Smin / Sp)

Relationships among variables (species) no stronger than expected chance

Compare lowest final stress with average final stress from a large number of randomizations of the data matrix, shuffling within columns, before calculation of distance matrix.

 

When in doubt, simply report the final stress, which is an inverse measure of fit. However, people often like to think of fit with an R2–like statistic. The nonmetric fit is closest to the "native" measure of fit, but one can argue that it exaggerates the fit by comparing the result to an unrealistic null model.


--
You received this message because you are subscribed to the Google Groups "PC-ORD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pc-ord+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pc-ord/919fdcee-f7d8-4f6c-aba4-916b5e807bd4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages