library(pls) #only for preloaded data
library(plsdepot)
plsreg1(yarn$NIR, yarn$density) #using preloaded yarn dataset from pls library
PLS Regression 1
--------------------------------------------
$x.scores X-scores (T-components)
$x.loads X-loadings
$y.scores Y-scores (U-components)
$y.loads Y-loadings
$cor.xyt score correlations
$raw.wgs raw weights
$mod.wgs modified weights
$std.coefs standard coefficients
$reg.coefs regular coefficients
$R2 R-squared
$R2Xy explained variance of X-y by T
$y.pred y-predicted
$resid residuals
$T2 T2 hotelling
$Q2 Q2 cross validation
--------------------------------------------
We can access the raw weights via:
#Example of first 5 rows of weights matrix.
head(plsreg1(yarn$NIR, yarn$density)$raw.wgs #or plsreg1(yarn$NIR, yarn$density)[6]
w1 w2
X1 0.01716477 -0.04809644
X2 0.03875600 -0.06025352
X3 0.04857839 -0.06807797
X4 0.05023674 -0.07540982
X5 0.04571729 -0.08515648
X6 0.03690089 -0.09647263
Same goes for the $mod.wgs modified weights