Learn R Programming

mixOmics (version 2.8-1)

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

Description

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

Usage

plsda(X, Y, ncomp = 2, max.iter = 500, scaleY = TRUE, mode = "regression", tol = 1e-06)

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.
scaleY
logical, indicates if Y should be scaled or not.
mode
indicates the mode of analysis. It can be either 'regression', 'classic' or 'invariant'
tol
a not negative real, the tolerance used in the iterative algorithm.

Value

  • plsda returns an object of class "pls", a list that contains the following components:
  • Xthe centered and standardized original predictor matrix.
  • Ythe 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.

encoding

latin1

Details

plsda function fit PLS models with $1, \ldots ,$ncomp components to the indicator matrix Y. If a factor is supplied, the appropriate indicator matrix is created.

References

P�rez-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 r�gression PLS: th�orie et pratique. Paris: Editions Technic.

See Also

splsda, summary, plotIndiv, plotVar, plot3dIndiv, plot3dVar.

Examples

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

res <- plsda(X, Y, ncomp = 2)
palette(c("red", "blue"))
plotIndiv(res, ind.names = TRUE, col = as.numeric(Y))
legend(18, -9, c("After", "Before"), pch = c(16, 16), 
       col = c("red", "blue"), cex = 1, pt.cex = c(1.2, 1.2), 
       title = "Treatment")
palette("default")

# Second example
data(liver.toxicity)
X = as.matrix(liver.toxicity$gene)
Y = as.factor(liver.toxicity$treatment[,4])
plsda.liver = plsda(X, Y, ncomp = 2,  mode = 'regression')
col = as.numeric(Y)
plotIndiv(plsda.liver, col = col)

Run the code above in your browser using DataLab