plot.mvr {pls.pcr} | R Documentation |
Several different ways of plotting a mvr
object are
supported:
type="validation"
type="prediction"
type="loadings"
type="scores"
type="coefficients"
plot.mvr(x, plottype=c("prediction", "validation", "coefficients", "scores", "loadings"), nlv, which=1:2, ...)
x |
an MVR object. |
plottype |
type of plot. (Wow!) |
which |
whether training data (1), validation data (2) or both
(1:2) should be shown in the prediction mode of this
function. |
nlv |
the number of latent variables to take into account. For the
loadings and scores plotting types, this should be a
vector of length 2, defaulting to c(1, 2). In the
coefficients plotting type, this may be a vector. Not
relevant for the validation plotting type. |
... |
several other arguments for the plotting command (not all!) can be used, as well. To see which ones, just try or look at the code... |
T. Hastie, R. Tibshirani and J. Friedman, The elements of statistical learning, Springer (2001).
data(NIR) attach(NIR) nir.pcr <- pcr(Xtrain,Ytrain,1:9, validat="CV") ## Not run: plot(nir.pcr) plot(nir.pcr, "coefficients", nlv=3:6, type="l") ## Not run: plot(nir.pcr, "prediction", nlv=3:6) plot(nir.pcr, "prediction", nlv=3:6, which=2) data(sensory) Pn <- scale(sensory$Panel) Ql <- scale(sensory$Quality) sens.simpls <- mvr(Ql, Pn, 1:5, method="SIMPLS") plot(sens.simpls, "loadings") plot(sens.simpls, "scores")