powered by
Perform a PLS discriminant analysis
plsda(X, Y, nc, scale = TRUE, center = TRUE, cv = TRUE, nr_folds = 5)
a list containing the following elements:
nc the number of components used(one joint components + number of orthogonal components
nc
scores a matrix of scores corresponding to the observations in X, The components retrieved correspond to the ones optimized or specified.
scores
X
Xloadings a matrix of loadings corresponding to the explanatory variables. The components retrieved correspond to the ones optimized or specified.
Xloadings
vip the VIP matrix.
vip
xvar variance explained of X by each single component.
xvar
R2Y variance explained of Y by each single component.
R2Y
PRESS The residual sum of squares for the samples which were not used to fit the model
PRESS
Q2 quality of cross-validation
Q2
a matrix of predictor variables.
a single vector indicate the group
the number of pls components (the one joint components + number of orthogonal components ).
logical indicating whether X must be scaled (suggest TRUE).
logical indicating whether X must be centered (suggest TRUE).
logical indicating whether cross-validation will be performed or not (suggest TRUE).
nr_folds Integer to indicate the folds for cross validation.
Kai Guo
X <- matrix(rnorm(500),10,50) Y <- rep(c("a","b"),each=5) fit <- plsda(X,Y,2)
Run the code above in your browser using DataLab