Learn R Programming

plsRglm (version 0.3.3)

kfolds2coeff: Extracts coefficients from kfold cross validated partial least squares regression models

Description

This fonction extracts coefficients from kfold cross validated partial least squares regression models

Usage

kfolds2coeff(pls_kfolds)

Arguments

pls_kfolds
an object that is a kfold cross validated partial least squares regression models either lm or glm

Value

  • coef.allmatrix 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 "lm" or "glm" plsR models.

References

~put references to the literature/web site here ~

See Also

kfolds2Pressind, kfolds2Press, kfolds2Mclassedind, kfolds2Mclassed and kfolds2CVinfos_lm to extract and transform results from kfold cross validation.

Examples

Run this code
data(Cornell)
XCornell<-Cornell[,1:7]
yCornell<-Cornell[,8]
data(aze_compl)
Xaze_compl<-aze_compl[,2:34]
yaze_compl<-aze_compl$y
data(pine)
Xpine<-pine[,1:10]
ypine<-pine[,11]
bbb <- PLS_v1_kfoldcv(dataY=yCornell,dataX=XCornell,nt=3,keepcoeffs=TRUE)
bbb2 <- PLS_v1_kfoldcv(dataY=log(ypine),dataX=Xpine,nt=4,keepcoeffs=TRUE)
kfolds2coeff(bbb)
boxplot(kfolds2coeff(bbb)[,1])
kfolds2coeff(bbb2)
boxplot(kfolds2coeff(bbb2)[,2])
rm(list=c("XCornell","yCornell","Xpine","ypine","bbb","bbb2"))

Run the code above in your browser using DataLab