validationplot(object, val.type = c("RMSEP", "MSEP", "R2"), estimate,
newdata, ncomp, comps, intercept, ...)
## S3 method for class 'mvrVal':
plot(x, nCols, nRows, type = "l", lty = 1:nEst, lwd = NULL,
pch = 1:nEst, cex = NULL, col = 1:nEst, legendpos,
xlab = "number of components", ylab = x$type, main, \dots)mvr object.RMSEP.RMSEP.plot.mvrVal tries
to be intelligent."l" (lines). Alternative types include "p" (points)
and "b" (both). See plot for a complete list
of tpar
for the details).points for all alternatives.par for the details.legendpos = "topright"). This requires
R>= 2.1.0. Alternatively, the position can be specified
expression(R^2) or lists. See title for details.validationplot calls the proper validation function (currently
MSEP, RMSEP or R2) and plots
the results with plot.mvrVal. validationplot can be
called through the mvr plot method, by specifying
plottype = "validation". plot.mvrVal creates one plot for each response variable in the
model, laid out in a rectangle. It uses matplot for
performing the actual plotting. If legendpos is given, a
legend is drawn at the given position.
The argument main can be used to specify the main title of the
plot. It is handled in a non-standard way. If there is only on (sub)
plot, main will be used as the main title of the plot. If
there is more than one (sub) plot, however, the presence of
main will produce a corresponding cex.main, supplied to
coefplot will only affect the par, which will affect both
titles. (To have different settings for the two titles, one can
override the par settings with arguments to the plot function.)
mvr, plot.mvr, RMSEP,
MSEP, R2, matplot,
legenddata(oliveoil)
mod <- plsr(sensory ~ chemical, data = oliveoil, validation = "LOO")
## These three are equivalent:
validationplot(mod, estimate = "all")
plot(mod, "validation", estimate = "all")
plot(RMSEP(mod, estimate = "all"))
## Plot R2:
plot(mod, "validation", val.type = "R2")
## Plot R2, with a legend:
plot(mod, "validation", val.type = "MSEP", legendpos = "top") # R >= 2.1.0Run the code above in your browser using DataLab