oplsda: Orthogonal partial least squares discriminant analysis

View source: R/o2plsda.R

oplsdaR Documentation

Orthogonal partial least squares discriminant analysis

Description

Computes orthogonal scores partial least squares regressions with the NIPALS algorithm. It return a comprehensive set of pls outputs (e.g. scores and vip).

Usage

oplsda(X, Y, nc, scale = FALSE, center = TRUE, maxiter = 100, tol = 1e-05)

Arguments

X

a O2pls object or a matrix of predictor variables.

Y

a single vector indicate the group

nc

the number of pls components (the one joint components + number of orthogonal components ).

scale

logical indicating whether X must be scaled (suggest TRUE).

center

boolean values determining if data should be centered or not

maxiter

maximum number of iterations.

tol

limit for convergence of the algorithm in the nipals algorithm.

Value

a list containing the following elements:

  • nc the number of components used(one joint components + number of orthogonal components

  • scores a matrix of scores corresponding to the observations in X, The components retrieved correspond to the ones optimized or specified.

  • Xloadings a matrix of loadings corresponding to the explanatory variables. The components retrieved correspond to the ones optimized or specified.

  • Yloadings a matrix of partial least squares loadings corresponding to Y

  • vip the VIP matrix.

  • xvar a matrix indicating the standard deviation of each component (sd), the variance explained by each single component (explained_var) and the cumulative explained variance (cumulative_explained_var). These values are computed based on the data used to create the projection matrices.

  • projection_matrix the matrix of projection matrix

  • weight a matrix of partial least squares ("pls") weights.

Author(s)

Kai Guo

Examples

X <- matrix(rnorm(50),10,5)
Y <- matrix(rnorm(50),10,5)
fit <- o2pls(X,Y,2,1,1)
yy <- rep(c(0,1),5)
fit0 <- oplsda(fit,yy,2)

o2plsda documentation built on Sept. 11, 2024, 8:28 p.m.