plo_coef {morepls}R Documentation

Plot of coefficients

Description

Plots the coefficients from a PLS regression.

Usage

plo_coef(object, y = NULL, ncomp = NULL, sort = FALSE,
                     col = "darkgreen", repel = FALSE,
                     max.pval = NULL, whiskers = FALSE, ci = 0.95)

Arguments

object

an object of class mvr from pls package

y

the name of the response variable whose coefficients are plotted. If NULL (default), the first response variable is used.

ncomp

the number of components to use for computing coefficients

sort

logical. If TRUE, bars are sorted by decreasing coefficients. Default is FALSE.

col

color of the bars

repel

logical. If TRUE, the names of the variables are repelled with geom_text_repel. Default is FALSE

max.pval

coefficients with jack-knife p-values higher than max.pval have a more transparent color bar. If NULL (default), all bars have the same opacity. If not NULL, object must be cross-validated with jackknife = TRUE.

whiskers

logical. If TRUE, whiskers are added to represent the confidence interval of the coefficients. Default is FALSE. If TRUE, object must be cross-validated with jackknife = TRUE.

ci

the confidence level of the confidence interval. Only used if whiskers is TRUE. Default is 0.95.

Value

a ggplot2 object

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_ctr, plo_vip, jack.test,

Examples

library(pls)
data(yarn)
pls <- mvr(density ~ NIR,
           ncomp = 5,
           data = yarn,
           validation = "CV",
           method = "oscorespls",
           jackknife = TRUE)
plo_coef(pls)
plo_coef(pls, max.pval = 0.05)
plo_coef(pls, whiskers = TRUE)

[Package morepls version 0.1 Index]