goodness.metaMDS.RdFunction goodness.metaMDS find goodness of fit measure for
points in nonmetric multidimensional scaling, and function
stressplot makes a Shepard diagram.
# S3 method for metaMDS goodness(object, dis, ...) # S3 method for default stressplot(object, dis, pch, p.col = "blue", l.col = "red", lwd = 2, ...)
| object | |
|---|---|
| dis | Dissimilarities. This should not be used with
|
| pch | Plotting character for points. Default is dependent on the number of points. |
| p.col, l.col | Point and line colours. |
| lwd | Line width. For |
| ... | Other parameters to functions, e.g. graphical parameters. |
Function goodness.metaMDS finds a goodness of fit statistic
for observations (points). This is defined so that sum of squared
values is equal to squared stress. Large values indicate poor fit.
The absolute values of the goodness statistic depend on the
definition of the stress: isoMDS expresses
stress in percents, and therefore its goodness values are 100 times
higher than those of monoMDS which expresses the
stress as a proportion.
Function stressplot draws a Shepard diagram which is a plot
of ordination distances and monotone or linear fit line against
original dissimilarities. In addition, it displays two
correlation-like statistics on the goodness of fit in the graph.
The nonmetric fit is based on stress \(S\) and defined as \(R^2
= 1-S^2\). The “linear fit” is the squared
correlation between fitted values and ordination distances. For
monoMDS, the “linear fit” and \(R^2\)
from “stress type 2” are equal.
Both functions can be used with metaMDS,
monoMDS and isoMDS. The original
dissimilarities should not be given for monoMDS or
metaMDS results (the latter tries to reconstruct the
dissimilarities using metaMDSredist if
isoMDS was used as its engine). With
isoMDS the dissimilarities must be given. In
either case, the functions inspect that dissimilarities are
consistent with current ordination, and refuse to analyse
inconsistent dissimilarities. Function goodness.metaMDS is
generic in vegan, but you must spell its name completely with
isoMDS which has no class.
Function goodness returns a vector of values. Function
stressplot returns invisibly an object with items for
original dissimilarities, ordination distances and fitted values.
metaMDS, monoMDS,
isoMDS, Shepard. Similar
diagrams for eigenvector ordinations can be drawn with
stressplot.wcmdscale, stressplot.cca,
stressplot.rda and stressplot.capscale.
#> Square root transformation #> Wisconsin double standardization #> Run 0 stress 0.1843196 #> Run 1 stress 0.2169271 #> Run 2 stress 0.2066174 #> Run 3 stress 0.1858401 #> Run 4 stress 0.1858401 #> Run 5 stress 0.1825658 #> ... New best solution #> ... Procrustes: rmse 0.04170056 max resid 0.1521502 #> Run 6 stress 0.2295043 #> Run 7 stress 0.2085949 #> Run 8 stress 0.2088294 #> Run 9 stress 0.1845801 #> Run 10 stress 0.1825658 #> ... New best solution #> ... Procrustes: rmse 3.068258e-05 max resid 7.382445e-05 #> ... Similar to previous best #> Run 11 stress 0.2820427 #> Run 12 stress 0.1948415 #> Run 13 stress 0.210541 #> Run 14 stress 0.195049 #> Run 15 stress 0.2028828 #> Run 16 stress 0.2066173 #> Run 17 stress 0.2290139 #> Run 18 stress 0.1955859 #> Run 19 stress 0.2141079 #> Run 20 stress 0.1825658 #> ... New best solution #> ... Procrustes: rmse 5.83731e-05 max resid 0.0001792664 #> ... Similar to previous best #> *** Solution reachedstressplot(mod)#> [1] 0.02984512 0.03513697 0.04189126 0.04598259 0.04003020 0.03441458 #> [7] 0.03294894 0.03049970 0.03060826 0.02994198 0.03526347 0.02621467 #> [13] 0.03831042 0.02980927 0.03369467 0.02225803 0.03561665 0.03505157 #> [19] 0.06577434 0.03268538 0.03503050 0.02956713 0.05167968 0.04602148