plsdepot (version 0.1.17)

plsreg2: PLS-R2: Partial Least Squares Regression 2

Description

The function plsreg2 performs partial least squares regression for the multivariate case (i.e. more than one response variable)

Usage

plsreg2(predictors, responses, comps = 2, crosval = TRUE)

Arguments

predictors
A numeric matrix or data frame containing the predictor variables.
responses
A numeric matrix or data frame containing the response variables.
comps
The number of extracted PLS components (2 by default)
crosval
Logical indicating whether cross-validation should be performed (TRUE by default). No cross-validation is done if there is missing data or if there are less than 10 observations.

Value

An object of class "plsreg2", basically a list with the following elements:
x.scores
components of the predictor variables (also known as T-components)
x.loads
loadings of the predictor variables
y.scores
components of the response variables (also known as U-components)
y.loads
loadings of the response variables
cor.xt
correlations between X and T
cor.yt
correlations between Y and T
cor.xu
correlations between X and U
cor.yu
correlations between Y and U
cor.tu
correlations between T and U
raw.wgs
weights to calculate the PLS scores with the deflated matrices of predictor variables
mod.wgs
modified weights to calculate the PLS scores with the matrix of predictor variables
std.coefs
Vector of standardized regression coefficients (used with scaled data)
reg.coefs
Vector of regression coefficients (used with the original data)
y.pred
Vector of predicted values
resid
Vector of residuals
expvar
table with R-squared coefficients
VIP
Variable Importance for Projection
Q2
table of Q2 indexes (i.e. leave-one-out cross validation)
Q2cum
table of cummulated Q2 indexes

Details

The minimum number of PLS components comps to be extracted is 2.

The data is scaled to standardized values (mean=0, variance=1).

The argument crosval gives the option to perform cross-validation. This parameter takes into account how comps is specified. When comps=NULL, the number of components is obtained by cross-validation. When a number of components is specified, cross-validation results are calculated for each component.

References

Geladi, P., and Kowlaski, B. (1986) Partial Least Squares Regression: A Tutorial. Analytica Chimica Acta, 185, pp. 1-17.

Hoskuldsson, A. (1988) PLS Regression Methods. Journal of Chemometrics, 2, pp. 211-228.

Tenenhaus, M. (1998) La Regression PLS. Theorie et Pratique. Editions TECHNIP, Paris.

See Also

plot.plsreg2, plsreg1.

Examples

Run this code
## Not run: 
#  ## example of PLSR2 with the vehicles dataset
#  data(vehicles)
# 
#  # apply plsreg2 extracting 2 components (no cross-validation)
#  pls2_one = plsreg2(vehicles[,1:12], vehicles[,13:16], comps=2, crosval=FALSE)
# 
#  # apply plsreg2 with selection of components by cross-validation
#  pls2_two = plsreg2(vehicles[,1:12], vehicles[,13:16], comps=NULL, crosval=TRUE)
# 
#  # apply plsreg2 extracting 5 components with cross-validation
#  pls2_three = plsreg2(vehicles[,1:12], vehicles[,13:16], comps=5, crosval=TRUE)
# 
#  # plot variables
#  plot(pls2_one)
#  ## End(Not run)

Run the code above in your browser using DataLab