Learn R Programming

plsRglm (version 0.3.3)

plsR: Partial least squares Regression models with leave one out cross validation

Description

This function implements Partial least squares Regression models with leave one out cross validation for complete or incomplete datasets.

Usage

plsR(dataY, dataX, nt = 2, limQ2set = 0.0975, dataPredictY = dataX, modele = "pls", family = NULL, typeVC = "none", EstimXNA = FALSE, scaleX = TRUE, scaleY = NULL, pvals.expli = FALSE, alpha.pvals.expli = 0.05, MClassed = FALSE, tol_Xi = 10^(-12))

Arguments

dataY
response (training) dataset
dataX
predictor(s) (training) dataset
nt
number of components to be extracted
limQ2set
limit value for the Q2
dataPredictY
predictor(s) (testing) dataset
modele
name of the PLS model to be fitted, only ("pls" available for this fonction.
family
for the present moment the family argumlent is ignored and set thanks to the value of modele.
typeVC
type of leave one out crossed validation. Several procedures are available and may be forced. [object Object],[object Object],[object Object],[object Object]
EstimXNA
only for modele="pls". Set whether the missing X values have to be estimated.
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.
pvals.expli
should individual p-values be reported to tune model selection ?
alpha.pvals.expli
level of significance for predictors when pvals.expli=TRUE
MClassed
number of missclassed cases, should only be used for binary responses
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

  • nrDescription of 'comp1'
  • ncDescription of 'comp2'
  • ntDescription of 'comp2'
  • wwDescription of 'comp2'
  • wwnormDescription of 'comp2'
  • wwetoileDescription of 'comp2'
  • ttDescription of 'comp2'
  • ppDescription of 'comp2'
  • CoeffCDescription of 'comp2'
  • uscoresDescription of 'comp2'
  • YChapeauDescription of 'comp2'
  • residYChapeauDescription of 'comp2'
  • RepYDescription of 'comp2'
  • na.miss.YDescription of 'comp2'
  • YNADescription of 'comp2'
  • residYDescription of 'comp2'
  • ExpliXDescription of 'comp2'
  • na.miss.XDescription of 'comp2'
  • XXNADescription of 'comp2'
  • residXXDescription of 'comp2'
  • PredictYDescription of 'comp2'
  • press.indDescription of 'comp2'
  • press.totDescription of 'comp2'
  • famillyDescription of 'comp2'
  • ttPredictYDescription of 'comp2'
  • typeVCDescription of 'comp2'
  • dataYDescription of 'comp2'
  • computed_ntDescription of 'comp2'
  • CoeffCFullDescription of 'comp2'
  • CoeffConstanteDescription of 'comp2'
  • Std.CoeffsDescription of 'comp2'
  • press.ind2Description of 'comp2'
  • RSSresidYDescription of 'comp2'
  • CoeffsDescription of 'comp2'
  • YresidusDescription of 'comp2'
  • RSSDescription of 'comp2'
  • residusYDescription of 'comp2'
  • AIC.stdAIC.std vs number of components (AIC computed for the standardized model
  • AICAIC vs nber of components
  • optionalIf the response is assumed to be binary: i.e. MClassed=TRUE. [object Object],[object Object],[object Object]
  • ttPredictFittedMissingYDescription of 'comp2'
  • optionalIf cross validation was requested: i.e. typeVC="standard", typeVC="missingdata" or typeVC="adaptative". [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
  • optionalIf no cross validation was requested : i.e. typeVC="none". [object Object]
  • Std.ValsPredictYDescription of 'comp2'
  • ValsPredictYDescription of 'comp2'
  • Std.XChapeauDescription of 'comp2'
  • XXwotNADescription of 'comp2'

Details

There are several ways to deal with missing values that leads to different computations of leave one out cross validation criteria.

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

plsRglm

Examples

Run this code
data(Cornell)
XCornell<-Cornell[,1:7]
yCornell<-Cornell[,8]
plsR(yCornell,XCornell,10)$InfCrit
plsR(yCornell,XCornell,10,typeVC="standard")$CVinfos
plsR(yCornell,XCornell,6)$AIC 
plsR(yCornell,XCornell,6)$AIC.std    
rm(list=c("XCornell","yCornell"))


data(aze_compl)
Xaze_compl<-aze_compl[,2:34]
yaze_compl<-aze_compl$y

modpls <- plsR(yaze_compl,Xaze_compl,10,MClassed=TRUE)

modpls$AIC
modpls$AIC.std
modpls$MissClassed
modpls$Probs
modpls$Probs.trc
modpls$Probs-modpls$Probs.trc

modpls$InfCrit
plsR(yaze_compl,Xaze_compl,10)$InfCrit

plsR(yaze_compl,Xaze_compl,10,typeVC="standard")$CVinfos
plsR(yaze_compl,Xaze_compl,10,typeVC="standard",MClassed=TRUE)$CVinfos
rm(list=c("Xaze_compl","yaze_compl","modpls"))


dimX <- 24
Astar <- 2
simul_data_UniYX(dimX,Astar)
dataAstar2 <- t(replicate(250,simul_data_UniYX(dimX,Astar)))
ydataAstar2 <- dataAstar2[,1]
XdataAstar2 <- dataAstar2[,2:(dimX+1)]
ysimbin1 <- dicho(ydataAstar2)
Xsimbin1 <- dicho(XdataAstar2)
plsR(ysimbin1,Xsimbin1,10,MClassed=TRUE)$Probs
plsR(ysimbin1,Xsimbin1,10,MClassed=TRUE)$Probs.trc
plsR(ysimbin1,Xsimbin1,10,MClassed=TRUE)$MissClassed
plsR(ysimbin1,Xsimbin1,10,typeVC="standard",MClassed=TRUE)$CVinfos
plsR(ysimbin1,XdataAstar2,10,typeVC="standard",MClassed=TRUE)$CVinfos
plsR(ydataAstar2,XdataAstar2,10,typeVC="standard")$CVinfos
rm(list=c("dimX","Astar","dataAstar2","ysimbin1","Xsimbin1","ydataAstar2","XdataAstar2"))


dimX <- 6
Astar <- 4
dataAstar4 <- t(replicate(250,simul_data_UniYX(dimX,Astar)))
ydataAstar4 <- dataAstar4[,1]
XdataAstar4 <- dataAstar4[,2:(dimX+1)]
modpls <- plsR(ydataAstar4,XdataAstar4,10,typeVC="standard")
modpls$computed_nt
modpls$CVinfos
str(modpls)
rm(list=c("dimX","Astar","dataAstar4","modpls","ydataAstar4","XdataAstar4"))


dimX <- 24
Astar <- 2
dataAstar2 <- t(replicate(250,simul_data_UniYX(dimX,Astar)))
ydataAstar2 <- dataAstar2[,1]
XdataAstar2 <- dataAstar2[,2:(dimX+1)]
modpls <- plsR(ydataAstar2,XdataAstar2,10,typeVC="standard")
modpls$computed_nt
modpls$CVinfos
rm(list=c("dimX","Astar","dataAstar2","modpls","ydataAstar2","XdataAstar2"))


dimX <- 24
Astar <- 3
dataAstar3 <- t(replicate(200,simul_data_UniYX(dimX,Astar)))
ydataAstar3 <- dataAstar3[,1]
XdataAstar3 <- dataAstar3[,2:(dimX+1)]
modpls <- plsR(ydataAstar3,XdataAstar3,10,typeVC="standard")
modpls$computed_nt
modpls$CVinfos
rm(list=c("dimX","Astar","dataAstar3","modpls","ydataAstar3","XdataAstar3"))


dimX <- 24
Astar <- 4
dataAstar4 <- t(replicate(200,simul_data_UniYX(dimX,Astar)))
ydataAstar4 <- dataAstar4[,1]
XdataAstar4 <- dataAstar4[,2:(dimX+1)]
modpls <- plsR(ydataAstar4,XdataAstar4,10,typeVC="standard")
modpls$computed_nt
modpls$CVinfos
rm(list=c("dimX","Astar","dataAstar4","modpls","ydataAstar4","XdataAstar4"))


dimX <- 24
Astar <- 5
dataAstar5 <- t(replicate(200,simul_data_UniYX(dimX,Astar)))
ydataAstar5 <- dataAstar5[,1]
XdataAstar5 <- dataAstar5[,2:(dimX+1)]
modpls <- plsR(ydataAstar5,XdataAstar5,10,typeVC="standard")
modpls$computed_nt
modpls$CVinfos
rm(list=c("dimX","Astar","dataAstar5","modpls","ydataAstar5","XdataAstar5"))


dimX <- 24
Astar <- 6
dataAstar6 <- t(replicate(200,simul_data_UniYX(dimX,Astar)))
ydataAstar6 <- dataAstar6[,1]
XdataAstar6 <- dataAstar6[,2:(dimX+1)]
modpls <- plsR(ydataAstar3,XdataAstar6,10,typeVC="standard")
modpls$computed_nt
modpls$CVinfos
rm(list=c("dimX","Astar","dataAstar6","modpls","ydataAstar6","XdataAstar6"))

Run the code above in your browser using DataLab