Learn R Programming

mixOmics (version 5.1.2)

plsda: Partial Least Squares Discriminant Analysis (PLS-DA).

Description

Function to perform standard Partial Least Squares regression to classify samples.

Usage

plsda(X, Y, ncomp = 2, max.iter = 500, tol = 1e-06, near.zero.var = TRUE)

Arguments

X
numeric matrix of predictors. NAs are allowed.
Y
a factor or a class vector for the discrete outcome.
ncomp
the number of components to include in the model. Default to 2.
max.iter
integer, the maximum number of iterations.
tol
a not negative real, the tolerance used in the iterative algorithm.
near.zero.var
boolean, see the internal nearZeroVar function (should be set to TRUE in particular for data with many zero values). Setting this argument to FALSE (when appropriate) will speed up the computations.

Value

  • plsda returns an object of class "plsda", a list that contains the following components:
  • Xthe centered and standardized original predictor matrix.
  • Ythe centered and standardized indicator response vector or matrix.
  • ind.matthe indicator matrix.
  • ncompthe number of components included in the model.
  • mat.cmatrix of coefficients to be used internally by predict.
  • variateslist containing the X and Y variates.
  • loadingslist containing the estimated loadings for the variates.
  • nameslist containing the names to be used for individuals and variables.
  • nzvlist containing the zero- or near-zero predictors information.
  • tolthe tolerance used in the iterative algorithm, used for subsequent S3 methods
  • max.iterthe maximum number of iterations, used for subsequent S3 methods
  • iterNumber of iterations of the algorthm for each component

encoding

latin1

Details

plsda function fit PLS models with $1,...,$ncomp components to the factor or class vector Y. The appropriate indicator matrix is created.

References

Perez-Enciso, M. and Tenenhaus, M. (2003). Prediction of clinical outcome with microarray data: a partial least squares discriminant analysis (PLS-DA) approach. Human Genetics 112, 581-592.

Nguyen, D. V. and Rocke, D. M. (2002). Tumor classification by partial least squares using microarray gene expression data. Bioinformatics 18, 39-50.

Tenenhaus, M. (1998). La regression PLS: theorie et pratique. Paris: Editions Technic.

See Also

splsda, summary, plotIndiv, plotVar, plot3dIndiv, plot3dVar, predict, perf and http://mixOmics.org for more details.

Examples

Run this code
## First example
data(breast.tumors)
X <- breast.tumors$gene.exp
Y <- breast.tumors$sample$treatment

plsda.breast <- plsda(X, Y, ncomp = 2)
plotIndiv(plsda.breast, ind.names = TRUE, plot.ellipse = TRUE, add.legend = TRUE)

## Second example
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$treatment[, 4]

plsda.liver <- plsda(X, Y, ncomp = 2)
plotIndiv(plsda.liver, ind.names = Y, plot.ellipse = TRUE, add.legend =TRUE)

Run the code above in your browser using DataLab