Learn R Programming

plsRglm (version 0.3.3)

PLS_v2_wvc: Light version of PLS_v2 for cross validation purposes

Description

Light version of PLS_v2 for cross validation purposes either on complete or incomplete datasets.

Usage

PLS_v2_wvc(dataY, dataX, nt = 2, dataPredictY = dataX, modele = "pls", family = NULL, scaleX = TRUE, scaleY = NULL, keepcoeffs = FALSE, keepstd.coeffs=FALSE, tol_Xi = 10^(-12))

Arguments

dataY
response (training) dataset
dataX
predictor(s) (training) dataset
nt
number of components to be extracted
dataPredictY
predictor(s) (testing) dataset
modele
name of the PLS glm model to be fitted ("pls", "pls-glm-gaussian", "pls-glm-logistic", "pls-glm-polr").
family
for the moment the family argumlent is ignored and set thanks to the value of modele
scaleX
scale the predictor(s) : must be set to TRUE for modele="pls" and should be for glms pls.
scaleY
scale the response : Yes/No. Ignored since non always possible for glm responses.
keepcoeffs
whether the coefficients of the linear fit on link scale of unstandardized eXplanatory variables should be returned or not.
keepstd.coeffs
whether the coefficients of the linear fit on link scale of standardized eXplanatory variables should be returned or not.
tol_Xi
minimal value for Norm2(Xi) and $\mathrm{det}(pp' \times pp)$ if there is any missing value in the dataX. It defaults to $10^{-12}$

Value

  • valsPredictnrow(dataPredictY) * nt matrix of the predicted values
  • coeffsIf the coefficients of the eXplanatory variables were requested: i.e. keepcoeffs=TRUE. ncol(dataX) * 1 matrix of the coefficients of the the eXplanatory variables

Details

This function is called by PLS_v2_kfoldcv in order to perform cross validation either on complete or incomplete datasets.

References

Nicolas Meyer, Myriam Maumy-Bertrand et Fr�d�ric{Fr'ed'eric} Bertrand (2010). Comparaison de la r�gression{r'egression} PLS et de la r�gression{r'egression} logistique PLS : application aux donn�es{donn'ees} d'all�lotypage{d'all'elotypage}. Journal de la Soci�t� Fran�aise de Statistique, 151(2), pages 1-18. http://smf4.emath.fr/Publications/JSFdS/151_2/pdf/sfds_jsfds_151_2_1-18.pdf

See Also

PLS_v2 for more detailed results, PLS_v2_kfoldcv for cross validating models and PLS_v1_wvc for the same function dedicated to plsR models

Examples

Run this code
data(Cornell)
XCornell<-Cornell[,1:7]
yCornell<-Cornell[,8]
PLS_v2_wvc(dataY=yCornell,dataX=XCornell,nt=3,modele="pls-glm-gaussian",dataPredictY=XCornell[1,])
PLS_v2_wvc(dataY=yCornell[-1],dataX=XCornell[-1,],nt=3,modele="pls-glm-gaussian",dataPredictY=XCornell[1,])
rm("XCornell","yCornell")

## With an incomplete dataset (X[1,2] is NA)
data(pine)
ypine <- pine[,11]
data(XpineNAX21)
PLS_v2_wvc(dataY=ypine,dataX=XpineNAX21,nt=10,modele="pls-glm-gaussian")
rm("XpineNAX21","ypine")


data(aze_compl)
Xaze_compl<-aze_compl[,2:34]
yaze_compl<-aze_compl$y
PLS_v2(yaze_compl,Xaze_compl,10,modele="pls-glm-logistic",typeVC="none")$InfCrit
PLS_v2_wvc(yaze_compl,Xaze_compl,10,modele="pls-glm-logistic", keepcoeffs=TRUE)
rm("Xaze_compl","yaze_compl")

Run the code above in your browser using DataLab