Skip to contents

Function to perform Partial Least Squares to classify samples (supervised analysis).

Usage

PLSda(X, Y, ncomp = 2)

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 (see Details).

Details

PLSda function fit PLS models with \(1, \ldots ,\)ncomp components to the factor or class vector Y. The appropriate indicator (dummy) matrix is created.

Value

PLSda returns an object of class "PLSda", a list that contains the following components:

X

the centered and standardized original predictor matrix.

Y

the centered and standardized indicator response vector or matrix.

ind.mat

the indicator matrix.

ncomp

the number of components included in the model.

mat.c

matrix of coefficients to be used internally by predict.

variates

list containing the variates.

loadings

list containing the estimated loadings for the X and Y variates.

names

list containing the names to be used for individuals and variables.

Author

Benoit Liquet and Pierre Lafaye de Micheaux.

See also

sPLS, summary, plotIndiv, plotVar, cim, network, predict, perf and http://www.mixOmics.org for more details.

Examples

library(sgPLSdevelop)

ncompmax <- 5
d <- data.cl.create(classes = 4, n = 30, list = TRUE)
X <- d$X
Y <- d$Y

modele <- PLSda(X = X, Y = Y, ncomp = ncompmax)