plot.mvr {pls.pcr}R Documentation

Plot a MVR object

Description

Several different ways of plotting a mvr object are supported:

type="validation"
plot of errors versus the number of latent variables. Standard errors are also shown, and the selected number of components is indicated, as suggested in Hastie et al. (2001).
type="prediction"
For each Y variable, a plot is produced of true versus predicted values. If validation data are available, both training and validation plots are shown. For each Y variable separate plots are made.
type="coefficients"
Shows regression vector for the selected number of latent variables.

Usage

plot.mvr(x,
         plottype=c("validation", "prediction", "coefficients"),
         nlv, which=1:2, ...)

Arguments

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 (in the coefficients plotting type, this may be a vector) to be used for the plot. Not relevant for the validation plotting type.
... optional arguments for the plotting command.

References

T. Hastie, R. Tibshirani and J. Friedman, The elements of statistical learning, Springer (2001).

Examples

data(NIR)
attach(NIR)
nir.pcr <- pcr(Xtrain,Ytrain,1:9, validat="CV")
plot(nir.pcr)
plot(nir.pcr, "coefficients", nlv=3:6, type="l")
plot(nir.pcr, "prediction", nlv=3:6)
plot(nir.pcr, "prediction", nlv=3:6, which=2)

[Package Contents]