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", ...)mvr object. The fitted model.length(ncomp) > 1, coefficients for each model size is plotted.TRUE, coefficients for different model
sizes are blotted in separate plots.coef.mvr for details.cumulative = FALSE. Defaults to
FALSE. See coef.mvr for details.coefplot tries
to be intelligent.TRUE, the $x$ axis tick marks
are labelled with the variable names."l" (lines). Alternative types include "p" (points)
and "b" (both). See plot for a complete list
of typepar
for the details).points for all alternatives.par for the details.separate is
TRUE. If present, a legend is drawn at the given position.
The position can be specified symbolically (e.g., legendpos =
"topright"). This requires expression(R^2) or lists. See title for details.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, legenddata(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