R/index.prediction.R

index.prediction=function(res, x){
k=nrow(res)
scor=rep(0,nrow(x))
for(i in 1:k){
 jmax=res[i,"jmax"]
 cutp=res[i,"cutp"]
 maxdir=res[i,"maxdir"]
  if(maxdir==1){ temp=1*(x[,jmax]> cutp)}
  if(maxdir==-1){ temp=1*(x[,jmax]< cutp)}
 scor=scor+temp
}
return(scor)
}

Try the AIM package in your browser

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

AIM documentation built on May 2, 2019, 3:02 a.m.