Skip to contents

This function computes PRESS for k-fold cross validated partial least squares regression models.

Usage

kfolds2Press(pls_kfolds)

Arguments

pls_kfolds

a k-fold cross validated partial least squares regression model

Value

list

Press vs number of components for the first group partition

list()

...

list

Press vs number of components for the last group partition

Note

Use cv.plsR to create k-fold cross validated partial least squares regression models.

References

Nicolas Meyer, Myriam Maumy-Bertrand et Frédéric Bertrand (2010). Comparing the linear and the logistic PLS regression with qualitative predictors: application to allelotyping data. Journal de la Societe Francaise de Statistique, 151(2), pages 1-18. https://www.numdam.org/item/JSFS_2010__151_2_1_0/

See also

kfolds2coeff, kfolds2Pressind, kfolds2Mclassedind and kfolds2Mclassed to extract and transforms results from k-fold cross validation.

Examples


data(Cornell)
XCornell<-Cornell[,1:7]
yCornell<-Cornell[,8]
kfolds2Press(cv.plsR(object=yCornell,dataX=data.frame(scale(as.matrix(XCornell))[,]),
nt=6,K=12,NK=1,verbose=FALSE))
#> [[1]]
#> [1] 55.70774 41.43274 20.27397 21.24240 24.51801
#> 
kfolds2Press(cv.plsR(object=yCornell,dataX=data.frame(scale(as.matrix(XCornell))[,]),
nt=6,K=6,NK=1,verbose=FALSE))
#> [[1]]
#> [1] 60.67384 37.44834 17.35983 25.14694 26.97979
#> 
rm(list=c("XCornell","yCornell"))

# \donttest{
data(pine)
Xpine<-pine[,1:10]
ypine<-pine[,11]
kfolds2Press(cv.plsR(object=ypine,dataX=Xpine,nt=10,NK=1,verbose=FALSE))
#> [[1]]
#>  [1] 13.11383 16.07115 16.80484 16.01002 15.72696 16.01078 16.72261 16.89642
#>  [9] 16.85360 17.47502
#> 
kfolds2Press(cv.plsR(object=ypine,dataX=Xpine,nt=10,NK=2,verbose=FALSE))
#> [[1]]
#>  [1] 14.34299 13.86224 14.29954 13.07896 13.11752 13.26533 14.52682 15.94571
#>  [9] 16.40371 16.99492
#> 
#> [[2]]
#>  [1] 15.67525 15.99173 18.33649 17.94999 16.68851 15.81142 16.55737 17.36604
#>  [9] 18.05244 18.14532
#> 

XpineNAX21 <- Xpine
XpineNAX21[1,2] <- NA
kfolds2Press(cv.plsR(object=ypine,dataX=XpineNAX21,nt=10,NK=1,verbose=FALSE))
#> [[1]]
#> [1] 14.27440 14.75048 16.91953 15.77344 16.32399 16.01672 18.12347 21.36587
#> [9] 19.93249
#> 
kfolds2Press(cv.plsR(object=ypine,dataX=XpineNAX21,nt=10,NK=2,verbose=FALSE))
#> [[1]]
#> [1] 15.98650 15.70826 14.85051 13.35485 21.30392 29.71824 21.93329 18.27147
#> [9] 18.92796
#> 
#> [[2]]
#> [1] 14.58396 15.69717 25.24154 14.46923 21.63037 12.84356 12.93730 28.12907
#> [9] 19.54269
#> 
rm(list=c("Xpine","XpineNAX21","ypine"))
# }