Learn R Programming

mixOmics (version 4.1-4)

plot.valid: Validation Plot

Description

Function to plot validation statistics, such as MSEP, RMSEP, $R^2$ or $Q^2$, as a function of the number of components.

Usage

## S3 method for class 'valid':
plot(x, criterion = c("MSEP", "RMSEP", "R2", "Q2"),
     pred.method = "all",
     xlab = "number of components", ylab = NULL,
     LimQ2 = 0.0975, LimQ2.col = "darkgrey",
     cTicks = NULL, layout = NULL, ...)

Arguments

x
an valid object.
criterion
character string. What type of validation criterion to plot for pls or spls. One of "MSEP", "RMSEP", "R2" or "Q2". See valid
pred.method
prediction method applied in valid for plsda or splsda. See valid.
xlab, ylab
titles for $x$ and $y$ axes. Typically character strings, but can be expressions (e.g., expression(R^2)).
LimQ2
numeric value. Signification limit for the components in the model. Default is LimQ2 = 0.0975.
LimQ2.col
character string specifying the color for the LimQ2 line to be plotted. If "none" the line will not be plotted.
cTicks
integer vector. Axis tickmark locations for the used number of components. Default is 1:ncomp (see valid).
layout
numeric vector of length two giving the number of rows and columns in a multi panel display. If not specified, plot.valid tries to be intelligent.
...
Further arguments sent to xyplot function.

encoding

latin1

Details

plot.valid creates one plot for each response variable in the model, laid out in a multi panel display. It uses xyplot for performing the actual plotting.

See Also

pls, spls, plsda, splsda, valid.

Examples

Run this code
require(lattice)

## validation for objects of class 'pls' or 'spls'
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic

liver.val <- valid(X, Y, ncomp = 5, mode = "regression", 
                   method = "pls", validation = "Mfold")
				   
plot(liver.val, criterion = "R2", type = "l", layout = c(2, 2))

## validation for objects of class 'plsda' or 'splsda'
data(srbct)
X <- srbct$gene
Y <- srbct$class  
  
error <- valid(X, Y, ncomp = 10, method = "splsda", M = 3, 
               keepX = rep(10, 10), pred.method = "all")

plot(error, type = "l")

Run the code above in your browser using DataLab