R/screen.ttest.R

Defines functions screen.ttest

Documented in screen.ttest

screen.ttest <- function(Y, X, family, obsWeights, id, rank = 2, ...) {
  # implemented with colttests from the genefilter package
  .SL.require('genefilter')
  if (family$family == "gaussian") {
	 stop('t-test screening undefined for gaussian family, look at screen.corP or screen.corRank')
  }
  if (family$family == "binomial") {
    listP <- genefilter::colttests(x = as.matrix(X), fac = as.factor(Y), tstatOnly = FALSE)$p.value
  }
  whichVariable <- (rank(listP) <= rank)
  return(whichVariable)
}

Try the SuperLearner package in your browser

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

SuperLearner documentation built on May 29, 2024, 5:25 a.m.