get_cor.Rd
Computes correlations between variables and scores from a PLS regression.
get_cor(object)
an object of class mvr
from pls
package.
A list with the following elements :
correlations between X variables and X scores
correlations between Y variables and X scores
correlations between X variables and Y scores
correlations between Y variables and Y scores
correlations between X variables and Y variables
correlations between X scores and Y scores
Martens, H., Næs, T. (1989) Multivariate calibration. Chichester: Wiley.
Tenenhaus, M. (1998) La Regression PLS. Theorie et Pratique. Editions TECHNIP, Paris.
library(pls)
data(yarn)
pls <- mvr(density ~ NIR,
ncomp = 5,
data = yarn,
validation = "CV",
method = "oscorespls")
res <- get_cor(pls)
str(res)
#> List of 6
#> $ Xt: num [1:268, 1:5] 0.246 0.461 0.546 0.544 0.48 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr [1:268] "V1" "V2" "V3" "V4" ...
#> .. ..$ : chr [1:5] "t1" "t2" "t3" "t4" ...
#> $ Yt: num [1, 1:5] 0.9906 0.0358 0.1178 0.0581 0.0114
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr "density"
#> .. ..$ : chr [1:5] "t1" "t2" "t3" "t4" ...
#> $ Xu: num [1:268, 1:5] 0.188 0.424 0.532 0.55 0.5 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr [1:268] "V1" "V2" "V3" "V4" ...
#> .. ..$ : chr [1:5] "u1" "u2" "u3" "u4" ...
#> $ Yu: num [1, 1:5] 1 0.137 0.1323 0.0602 0.0158
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr "density"
#> .. ..$ : chr [1:5] "u1" "u2" "u3" "u4" ...
#> $ XY: num [1:268, 1] 0.188 0.424 0.532 0.55 0.5 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr [1:268] "V1" "V2" "V3" "V4" ...
#> .. ..$ : chr "density"
#> $ tu: num [1:5, 1:5] 0.9906 0.0358 0.1178 0.0581 0.0114 ...
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr [1:5] "t1" "t2" "t3" "t4" ...
#> .. ..$ : chr [1:5] "u1" "u2" "u3" "u4" ...