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.