goodness.metaMDS {vegan} | R Documentation

## Goodness of Fit and Shepard Plot for Nonmetric Multidimensional Scaling

### Description

Function `goodness.metaMDS` find goodness of fit measure for points in nonmetric multidimensional scaling, and function `stressplot` makes a `Shepard` diagram.

### Usage

    ## S3 method for class 'metaMDS':
    goodness(object, dis, ...)
    stressplot(object, dis, pch, p.col = "blue", l.col = "red", lwd = 2,
        ...)

### Arguments

`object` | A result object from `metaMDS` or `isoMDS`.
`dis` | Dissimilarities. Normally this should not used with `metaMDS`, but should be always used with `isoMDS`.
`pch` | Plotting character for points. Default is dependent on the number of points.
`p.col, l.col` | Point and line colours.
`lwd` | Line width.
`...` | Other parameters to functions, e.g. graphical parameters.

### Details

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.

Function `stressplot` is a wrapper to `Shepard` function in MASS package. It plots ordination distances against original dissimilarities, and draws a step line of the nonlinear fit. In addition, it adds to the graph two correlation-like statistics on the goodness of fit. The nonmetric fit is based on stress S and defined as sqrt(1-S^2). The “linear fit” is the correlation between fitted values and ordination distances.

Both functions can be used both with `metaMDS` and with `isoMDS`. With `metaMDS`, the functions try to reconstruct the dissimilarities using `metaMDSredist`, and dissimilarities should not be given. 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.

### Value

Function `goodness` returns a vector of values. Function `stressplot` returns invisibly a `Shepard` object.

### Author(s)

Jari Oksanen.

### See Also

`metaMDS`, `isoMDS`, `Shepard`.

### Examples

    data(varespec)
    mod <- metaMDS(varespec)
    stressplot(mod)
    gof <- goodness(mod)
    gof
    plot(mod, display = "sites", type = "n")
    points(mod, display = "sites", cex = gof/2)

[Package vegan version 1.8-6 Index]