Learn R Programming

plsRglm (version 1.3.0)

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)

Arguments

pls_kfolds

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

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.

Details

This fonctions works for plsR and plsRglm models.

References

Nicolas Meyer, Myriam Maumy-Bertrand et Fr<U+00E9>d<U+00E9>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
# NOT RUN {
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"))

# }

Run the code above in your browser using DataLab