scree.plot: Plots the eingenvalues of an MDS analysis

Description Usage Arguments Details Value Note Author(s) See Also Examples

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")

Example output

Loading required package: amap
Loading required package: e1071
Loading required package: scales
Loading required package: cluster
Loading required package: rgl
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

bios2mds documentation built on April 14, 2020, 5:08 p.m.