Last chance! 50% off unlimited learning
Sale ends in
mvr
object.coefplot(object, ncomp = object$ncomp, separate = FALSE, cumulative = TRUE,
intercept = FALSE, nCols, nRows, varnames = FALSE, type = "l",
lty = 1:nLines, lwd = NULL, pch = 1:nLines, cex = NULL,
col = 1:nLines, legendpos, xlab = "variable",
ylab = "regression coefficient", ...)
coefplot
handles multiple responses by making one plot for each
response. If separate
is TRUE
, separate plots are made
for each combination of model size and response. The plots are laid
out in a rectangular fashion. If legendpos
is given, a legend is drawn at the given position
(unless separate
is TRUE
).
If varnames
is TRUE
, the $x$ axis tick marks are
labelled with the regressor variable names. Hint: If there is not
enough room for all names to be displayed, try reducing the text size
by giving the argument cex.axis
with a value less than 1, or
try printing the names vertically by giving the argument las = 3
.
The function can also be called through the mvr
plot method by
specifying plottype = "coefficients"
.
mvr
, plot.mvr
, coef.mvr
,
plot
, legend
data(NIR)
mod.nir <- plsr(y ~ X, ncomp = 8, data = NIR)
coefplot(mod.nir, ncomp = 1:6)
plot(mod.nir, plottype = "coefficients", ncomp = 1:6) # Equivalent to the previous
## Plot with legend:
coefplot(mod.nir, ncom = 1:6, legendpos = "bottomright")
data(sensory)
mod.sens <- plsr(Quality ~ Panel, ncomp = 4, data = sensory)
coefplot(mod.sens, ncomp = 2:4, separate = TRUE)
Run the code above in your browser using DataLab