Learn R Programming

pls (version 1.0-2)

predplot: Prediction Plots

Description

Functions to plot predicted values against measured values for a fitted model.

Usage

predplot(object, ...)
## S3 method for class 'default':
predplot(object, \dots)
## S3 method for class 'mvr':
predplot(object, ncomp = object$ncomp, which, newdata, nCols, 
         nRows, \dots)
predplotXy(x, y, line = FALSE, main = "Prediction plot",
           xlab = "measured response", ylab = "predicted response", ...)

Arguments

Value

  • The functions invisibly returns a matrix with the (last) plotted data.

encoding

latin1

Details

predplot is a generic function for plotting predicted versus measured response values, with default and mvr methods currently implemented. The default method is very simple, and doesn't handle multiple responses or new data.

The mvr method, predplot.mvr handles multiple responses, model sizes and types of predictions by making one plot for each combination. It can also be called through the plot method for mvr, by specifying plottype = "prediction" (the default).

predplotXy is an internal function and is not meant for interactive use.

See Also

mvr, plot.mvr

Examples

Run this code
data(NIR)
mod <- plsr(y ~ X, ncomp = 10, data = NIR[NIR$train,], CV = TRUE)
predplot(mod, ncomp = 1:6)
plot(mod, ncomp = 1:6) # Equivalent to the previous
## Both cross-validated and test set predictions:
predplot(mod, ncomp = 4:6, which = c("validation", "test"),
         newdata = NIR[!NIR$train,])

data(sensory)
mod.sens <- plsr(Quality ~ Panel, ncomp = 4, data = sensory)
plot(mod.sens, ncomp = 2:4) # Several responses gives several plots

Run the code above in your browser using DataLab