R/SISselection.R

Defines functions SIS.selection

Documented in SIS.selection

SIS.selection<-function(X,Y,pred,scale=F){
  if (scale==T){
    X<-scale(X)
  }
  p=dim(X)[2]
  IndicesSIS <- rep(0,p)
  beta <- rep(0,p)
  for (jj in 1:p){
    beta[jj]<-abs(glm(Y~X[,jj],family = binomial)$coefficients[2])
  }
  IndicesSIS <- sort(beta,index=TRUE,decreasing = TRUE)$ix		
  Xc<-X[,IndicesSIS[1:pred]] 
  Xsis <- Xc
  return(Xsis)
}

Try the lsplsGlm package in your browser

Any scripts or data that you put into this service are public.

lsplsGlm documentation built on July 27, 2017, 5:01 p.m.