Learn R Programming

RVAideMemoire (version 0.9-45-2)

PLSDA.ncomp: Graphical help to number of components selection in PLS-DA

Description

Draws a graph with classification error rate (obtained from cross-validation with the M-fold method) and proportion of intergroup variance explained from one to any possible components included in a given PLS-DA. This helps to choose the number of components to be kept in the model.

Usage

PLSDA.ncomp(X, Y, pred.method = c("mahalanobis.dist", "centroids.dist", "max.dist"),
  M = 10, nrep = 10)

Arguments

X
numeric matrix of predictors.
Y
a factor giving the class of each individual.
pred.method
prediction method to be applied for PLS-DA cross-validation. Should be a subset of "mahalanobis.dist" (default), "centroids.dist" or "max.dist".
M
the number of folds in the M-fold cross-validation.
nrep
the number of repetitions of the whole procedure in the M-fold cross-validation.

Details

The function emphasizes values obtained with nlev - 1 groups, with nlev being the number of levels of the factor, which is often the optimal number of components to be kept.

See Also

plsda, perf, DA.valid, DA.var

Examples

Run this code
require(mixOmics)
data(yeast)

X <- t(yeast$data)
Y <- yeast$strain.cond
# PLSDA.ncomp(X,Y)

Run the code above in your browser using DataLab