plsRglm (version 1.5.1)

kfolds2coeff: Extracts coefficients from k-fold cross validated partial least squares regression models

Description

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

Usage

kfolds2coeff(pls_kfolds)

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.

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.

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

Run this code

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(object=ypine,dataX=Xpine,nt=4,K=nrow(Xpine),keepcoeffs=TRUE,verbose=FALSE)
kfolds2coeff(bbb2)
boxplot(kfolds2coeff(bbb2)[,1])
rm(list=c("Xpine","ypine","bbb2"))

Run the code above in your browser using DataLab