plsda(X, Y, ncomp = 2, max.iter = 500, tol = 1e-06, near.zero.var = TRUE)
NA
s are allowed.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.plsda
returns an object of class "plsda"
, a list
that contains the following components:predict
.X
and Y
variates.plsda
function fit PLS models with $1,...,$ncomp
components
to the factor or class vector Y
. The appropriate indicator
matrix is created.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: theorie et pratique. Paris: Editions Technic.
splsda
, summary
,
plotIndiv
, plotVar
,
plot3dIndiv
, plot3dVar
, predict
, perf
and http://mixOmics.org for more details.## First example
data(breast.tumors)
X <- breast.tumors$gene.exp
Y <- breast.tumors$sample$treatment
plsda.breast <- plsda(X, Y, ncomp = 2)
palette(c("red", "blue"))
col.breast <- as.numeric(as.factor(Y))
plotIndiv(plsda.breast, ind.names = TRUE, col = col.breast)
legend('bottomleft', c("After", "Before"), pch = c(16, 16),
col = unique(col.breast), cex = 1, pt.cex = c(1.2, 1.2),
title = "Treatment")
palette("default")
## Second example
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$treatment[, 4]
plsda.liver <- plsda(X, Y, ncomp = 2)
col.rat <- as.numeric(as.factor(Y))
plotIndiv(plsda.liver, col = col.rat, ind.names = Y)
Run the code above in your browser using DataLab