Plots the eingenvalues of an MDS analysis

Share:

Description

Displays a bar plot of the eigenvalues obtained by MDS

Usage

1
2
scree.plot(x, lab = FALSE, title = NULL, xlim = NULL,
    ylim = NULL, new.plot = TRUE, pdf.file = NULL)

Arguments

x

a numeric vector representing the raw or the relative eigenvalues of each component.

lab

a boolean indicating whether bar labels should be displayed (TRUE) or not (FALSE). Default is FALSE.

title

a character string representing the title of the plot. Default is "Scree plot".

xlim

a numeric vector representing the range of the x values. Default is full range.

ylim

a numeric vector representing the range of the y values. Default is full range.

new.plot

a boolean indicating whether a new graphical device should be created (TRUE) or not (FALSE). Default is TRUE.

pdf.file

a string indicating the name and directory of the pdf graph outfile. Default is NULL. If this parameter is not NULL, the parameter new.plot is inactivated.

Details

A scree plot is a method for determining the optimal number of components useful to describe the data in the context of metric MultiDimensional Scaling (MDS). The scree plot is an histogram showing the eigenvalues of each component. The relative eigenvalues express the ratio of each eigenvalue to the sum of the eigenvalues. The relative eigenvalue of a component gives the proportion of the data variance explained by this component.

The aim is to evaluate the number of components required to capture most information contained in the data. In a scree plot, the relative eigenvalues decrease when the component number increases. The 'elbow' of the plot determines the optimal number of components to describe the data (usually the components before the 'elbow').

Value

Produces a bar plot on the active graphical device.

Note

The scree plot is not an exclusive method to determine the optimal number of components. A shepard plot, which is a scatterplot of the scaled MDS distances against the original distance data, can be another solution. See shepard function from MASS package.

Author(s)

Julien Pele

See Also

plot.pca.scree function from bio3d package.
goodness.metaMDS function from vegan package.

Examples

1
2
3
4
5
# displaying the scree plot of the MDS analysis of human GPCRs
data(gpcr)
active <- gpcr$dif$sapiens.sapiens
mmds1 <- mmds(active, pc = 5)
scree.plot(mmds1$eigen.perc, lab = TRUE, title = "Scree plot of metric MDS")