Learn R Programming

DiscriMiner (version 0.1-29)

plsDA_old: PLS Discriminant Analysis

Description

Performs a Partial Least Squares (PLS) Discriminant Analysis

Usage

plsDA_old(variables, group, autosel = TRUE, comps = 2, validation = NULL, learn = NULL, test = NULL, scaled = TRUE)

Arguments

variables
matrix or data frame with explanatory variables
group
vector or factor with group memberships
autosel
logical indicating automatic selection of PLS components by cross-validation. Default autosel=TRUE
comps
integer greater than one indicating the number of PLS components to retain. Used only when autosel=FALSE
validation
type of validation, either NULL or "learntest". Default NULL
learn
optional vector of indices for a learn-set. Only used when validation="learntest". Default NULL
test
optional vector of indices for a test-set. Only used when validation="learntest". Default NULL
scaled
logical indicating whether to scale the data (default TRUE)

Value

An object of class "plsda", basically a list with the following elements:
functions
table with discriminant functions
confusion
confusion matrix
scores
discriminant scores for each observation
classification
assigned class
error_rate
misclassification error rate
components
PLS components
Q2
quality of loo cross-validation
R2
R-squared coefficients
VIP
Variable Importance for Projection
comp_vars
correlations between components and variables
comp_group
correlations between components and groups

Details

When validation=NULL leave-one-out (loo) cross-validation is performed. When validation="learntest" validation is performed by providing a learn-set and a test-set of observations.

References

Tenenhaus M. (1998) La Regression PLS. Editions Technip, Paris.

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

See Also

classify, geoDA, linDA, quaDA

Examples

Run this code
## Not run: 
#   # load iris dataset
#   data(iris)
# 
#   # PLS discriminant analysis specifying number of components = 2
#   my_pls1 = plsDA(iris[,1:4], iris$Species, autosel=FALSE, comps=2)
#   my_pls1$confusion
#   my_pls1$error_rate
#   # plot circle of correlations
#   plot(my_pls1)
# 
#   # PLS discriminant analysis with automatic selection of components
#   my_pls2 = plsDA(iris[,1:4], iris$Species, autosel=TRUE)
#   my_pls2$confusion
#   my_pls2$error_rate
# 
#   # linear discriminant analysis with learn-test validation
#   learning = c(1:40, 51:90, 101:140)
#   testing = c(41:50, 91:100, 141:150)
#   my_pls3 = plsDA(iris[,1:4], iris$Species, validation="learntest", learn=learning, test=testing)
#   my_pls3$confusion
#   my_pls3$error_rate
#   ## End(Not run)

Run the code above in your browser using DataLab