screeplot.cca {vegan} | R Documentation

## Screeplots for Ordination Results and Broken Stick Distributions

### Description

Screeplot methods for plotting variances of ordination axes/components and overlaying broken stick distributions. Also, provides alternative screeplot methods for `princomp` and `prcomp`.

### Usage

    ## S3 method for class 'cca':
    screeplot(x, bstick = FALSE, type = c("barplot", "lines"),
             npcs = min(10, if (is.null(x$CCA)) x$CA$rank else x$CCA$rank),
             ptype = "o", bst.col = "red", bst.lty = "solid",
             xlab = "Component", ylab = "Inertia",
             main = deparse(substitute(x)),
             ...)

    ## S3 method for class 'decorana':
    screeplot(x, bstick = FALSE, type = c("barplot", "lines"),
             npcs = 4,
             ptype = "o", bst.col = "red", bst.lty = "solid",
             xlab = "Component", ylab = "Inertia",
             main = deparse(substitute(x)),
             ...)

    ## S3 method for class 'prcomp':
    screeplot(x, bstick = FALSE, type = c("barplot", "lines"),
             npcs = min(10, length(x$sdev)),
             ptype = "o", bst.col = "red", bst.lty = "solid",
             xlab = "Component", ylab = "Inertia",
             main = deparse(substitute(x)),
             ...)

    ## S3 method for class 'princomp':
    screeplot(x, bstick = FALSE, type = c("barplot", "lines"),
             npcs = min(10, length(x$sdev)),
             ptype = "o", bst.col = "red", bst.lty = "solid",
             xlab = "Component", ylab = "Inertia",
             main = deparse(substitute(x)),
             ...)

    bstick(n, ...)

    ## Default S3 method:
    bstick(n, tot.var = 1, ...)

    ## S3 method for class 'cca':
    bstick(n, ...)

    ## S3 method for class 'prcomp':
    bstick(n, ...)

    ## S3 method for class 'princomp':
    bstick(n, ...)

    ## S3 method for class 'decorana':
    bstick(n, ...)

### Arguments

`x` | an object from which the component variances can be determined.
`bstick` | logical; should the broken stick distribution be drawn?
`npcs` | the number of components to be plotted.
`type` | the type of plot.
`ptype` | if `type == "lines"` or `bstick = TRUE`, a character indicating the type of plotting used for the lines; actually any of the `type`s as in `plot.default`.
`bst.col, bst.lty` | the colour and line type used to draw the broken stick distribution.
`xlab, ylab, main` | graphics parameters.
`n` | an object from which the variances can be extracted or the number of variances (components) in the case of `bstick.default`.
`tot.var` | the total variance to be split.
`...` | arguments passed to other methods.

### Details

The functions provide screeplots for most ordination methods in vegan and enhanced versions with broken stick for `prcomp` and `princomp`.

Function `bstick` gives the brokenstick values which are ordered random proportions, defined as p[i] = tot/n sum(from x=i to n) 1/x (Pielou 1975), where tot is the total and n is the number of brokenstick components (cf. `radfit`). Broken stick has been recommended as a stopping rule in principal component analysis (Jackson 1993): principal components should be retained as long as observed eigenvalues are higher than corresponding random broken stick components.

The `bstick` function is generic. The default needs the number of components and the total, and specific methods extract this information from ordination results. There also is a `bstick` method for `cca`. However, the broken stick model is not strictly valid for correspondence analysis (CA), because eigenvalues of CA are defined to be <=1, whereas brokenstick components have no such restrictions. The brokenstick components are not available for `decorana` where the sum of eigenvalues (total inertia) is unknown, and the eigenvalues of single axes are not additive in detrended analysis.

### Value

For `screeplot`, a plot on the currently active device.
For `bstick`, a numeric vector of broken stick components.

### Note

Function `screeplot` is generic from `R` version 2.5.0. In these versions you can use plain `screeplot` command without suffices `cca`, `prcomp` etc.

### Author(s)

Gavin L. Simpson

### References

Jackson, D. A. (1993). Stopping rules in principal components analysis: a comparison of heuristical and statistical approaches. Ecology 74, 2204–2214.

Pielou, E.C. (1975) Ecological Diversity. Wiley & Sons.

### See Also

`cca`, `decorana`, `princomp` and `prcomp` for the ordination functions, and `screeplot` for the stock version.

### Examples

    data(varespec)
    vare.pca <- rda(varespec, scale = TRUE)
    bstick(vare.pca)
    screeplot.cca(vare.pca, bstick = TRUE, type = "lines")

[Package vegan version 1.8-6 Index]