R/rvsel_adapted.R

rvsel_adapted <- function(x,y,ad.alpha){
	n=nrow(x)
	coef=apply(x,2,function(one.var) summary(lm(y~one.var))$coef[2,1])
	coef.sign=sign(as.numeric(coef))
	coef.pval=apply(x,2,function(one.var) summary(lm(y~one.var))$coef[2,4])
	
	prot=which(coef.pval<=ad.alpha & coef.sign<0)
  x[,prot]=1-x[,prot]
	out=as.matrix(x)
return(out)
}

Try the rvsel package in your browser

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

rvsel documentation built on April 14, 2017, 7:15 p.m.