get_Q2.Rd
Computes Q2 and cumulative Q2 indexes from a PLS regression.
get_Q2(object)
an object of class mvr
from pls
package. It has to be cross-validated
A list with the following elements :
Q2 index by X variable and number of components
Q2 index by number of components
cumulative Q2 index by X variable and number of components
cumulative Q2 index by number of components
Martens, H., Næs, T. (1989) Multivariate calibration. Chichester: Wiley.
Tenenhaus, M. (1998) La Regression PLS. Theorie et Pratique. Editions TECHNIP, Paris.
library(pls)
#>
#> Attaching package: ‘pls’
#> The following object is masked from ‘package:stats’:
#>
#> loadings
data(yarn)
pls <- mvr(density ~ NIR,
ncomp = 5,
data = yarn,
validation = "CV",
method = "oscorespls")
res <- get_Q2(pls)
str(res)
#> List of 4
#> $ Q2kh : num [1, 1:5] 0.961 -0.367 0.655 0.749 -0.564
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr "density"
#> .. ..$ : chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#> $ Q2h : Named num [1:5] 0.961 -0.367 0.655 0.749 -0.564
#> ..- attr(*, "names")= chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#> $ Q2cumkh: num [1, 1:5] 0.961 0.947 0.982 0.995 0.993
#> ..- attr(*, "dimnames")=List of 2
#> .. ..$ : chr "density"
#> .. ..$ : chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...
#> $ Q2cumh : Named num [1:5] 0.961 0.947 0.982 0.995 0.993
#> ..- attr(*, "names")= chr [1:5] "1 comps" "2 comps" "3 comps" "4 comps" ...