Learn R Programming

resemble (version 1.2.2)

opls: orthogonal scores algorithn of partial leat squares (opls)

Description

Computes orthogonal socres partial least squares (opls) regressions with the NIPALS algorithm. It allows multiple response variables. For internal use only!

Usage

opls(X, Y, ncomp, scale, maxiter, tol, regression = TRUE, pcSelmethod = "cumvar", pcSelvalue = 0.99)

Arguments

X
a matrix of predictor variables.
Y
a matrix of either a single or multiple response variables.
ncomp
the number of pls components.
scale
logical indicating whether X must be scaled.
maxiter
maximum number of iterations.
tol
limit for convergence of the algorithm in the nipals algorithm.
regression
a logical indicating if the function is being used for regression. Otherwise it is used only for projection. Default is TRUE.
pcSelmethod
if regression = TRUE, the method for selecting the number of components. Options are: 'cumvar' (for selecting the number of principal components based on a given cumulative amount of explained variance) and "var" (for selecting the number of principal components based on a given amount of explained variance). Default is 'cumvar'
pcSelvalue
a numerical value that complements the selected method (pcSelmethod). If "cumvar" is chosen, it must be a value (higher than 0 and lower than 1) indicating the maximum amount of cumulative variance that the retained components should explain. If "var" is chosen, it must be a value (higher than 0 and lower than 1) indicating that components that explain (individually) a variance lower than this threshold must be excluded. If "manual" is chosen, it must be a value specifying the desired number of principal components to retain. Default is 0.99.

Value

a list containing the following elements:
  • coefficients the matrix of regression coefficients.
  • bo a matrix of one row containing the intercepts for each component.
  • scores the matrix of scores.
  • X.loadings the matrix of X loadings.
  • Y.loadings the matrix of Y loadings.
  • projectionM the projection matrix.
  • variance a list conating two objects: x.var and y.var. These objects contain information on the explained variance for the X and Y matrices respectively.
  • transf a list conating two objects: Xcenter and Xscale.