plo_var {morepls}R Documentation

Plot of loadings

Description

Plots the loadings of the variables of a PLS regression.

Usage

plo_var(object, comps = 1:2, which = "both", col = NULL,
 size = 3.88, Yline = TRUE, col.Yline = "firebrick3")

Arguments

object

an object of class mvr from pls package

comps

the components to use. Default is c(1,2).

which

character string. If "both" (default), X and Y variables are plotted. If "X", only X variables are plotted. If "Y", only Y variables are plotted.

col

colors for the names of the variables. Only one value should be provided if which is "X" or "Y", a vector of two if which is "both". If NULL (default), colors are set automatically.

size

numerical value. The size of the names of the variables.

Yline

logical. If TRUE (default), a line is drawn through the origin and the coordinates of the response variable, and a second line orthogonal to the first one. This is aimed at facilitating the interpretation.

col.Yline

the color of the lines drawn if Yline is TRUE. Default is "firebrick3".

Value

a ggplot2 object

Note

This is what Tenenhaus calls the multivariate interpretation of the PLS components, as opposed to the univariate interpretation provided by the correlations (see plo_cor). This superposes Y loadings (vectors from the C matrix) and projections, i.e. modified weights (vectors of the W* matrix).

Author(s)

Nicolas Robette

References

Martens, H., Næs, T. (1989) Multivariate calibration. Chichester: Wiley.

Tenenhaus, M. (1998) La Regression PLS. Theorie et Pratique. Editions TECHNIP, Paris.

See Also

plo_cor

Examples

library(pls)
data(yarn)
pls <- mvr(density ~ NIR,
           ncomp = 5,
           data = yarn,
           validation = "CV",
           method = "oscorespls")
plo_var(pls)

[Package morepls version 0.1 Index]