kfolds2coeff: Extracts coefficients from k-fold cross validated partial...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/kfolds2coeff.R

Description

This fonction extracts coefficients from k-fold cross validated partial least squares regression models

Usage

1
kfolds2coeff(pls_kfolds)

Arguments

pls_kfolds

an object that is a k-fold cross validated partial least squares regression models either lm or glm

Details

This fonctions works for plsR and plsRglm models.

Value

coef.all

matrix with the values of the coefficients for each leave one out step or NULL if another type of cross validation was used.

Note

Only for NK=1 and leave one out CV

Author(s)

Frédéric Bertrand
frederic.bertrand@math.unistra.fr
https://fbertran.github.io/homepage/

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. http://publications-sfds.math.cnrs.fr/index.php/J-SFdS/article/view/47

See Also

kfolds2Pressind, kfolds2Press, kfolds2Mclassedind, kfolds2Mclassed and summary to extract and transform results from k-fold cross validation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(Cornell)
XCornell<-Cornell[,1:7]
yCornell<-Cornell[,8]
bbb <- PLS_lm_kfoldcv(dataY=yCornell,dataX=XCornell,nt=3,K=nrow(XCornell),keepcoeffs=TRUE,
verbose=FALSE)
kfolds2coeff(bbb)
boxplot(kfolds2coeff(bbb)[,2])
rm(list=c("XCornell","yCornell","bbb"))

data(pine)
Xpine<-pine[,1:10]
ypine<-pine[,11]
bbb2 <- cv.plsR(dataY=ypine,dataX=Xpine,nt=4,K=nrow(Xpine),keepcoeffs=TRUE,verbose=FALSE)
kfolds2coeff(bbb2)
boxplot(kfolds2coeff(bbb2)[,1])
rm(list=c("Xpine","ypine","bbb2"))

plsRglm documentation built on March 16, 2021, 1:08 a.m.