Learn R Programming

mixOmics (version 2.9-2)

plot.valid: Validation Plot

Description

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

Usage

## S3 method for class 'valid':
plot(x, criterion = c("MSEP", "RMSEP", "R2"),
     xlab = "number of components", ylab = NULL,
     cTicks = 1:ncol(x[[1]]), layout = NULL, ...)

Arguments

x
an valid object.
criterion
character string. What type of validation criterion to plot. One of "MSEP", "RMSEP" or "R2".
xlab, ylab
titles for $x$ and $y$ axes. Typically character strings, but can be expressions (e.g., expression(R^2).
cTicks
integer vector. Axis tickmark locations for the used number of components. Default is from one to 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, predict.

Examples

Run this code
require(lattice)

data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic

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

Run the code above in your browser using DataLab