ttest               package:genefilter               R Documentation

_A _f_i_l_t_e_r _f_u_n_c_t_i_o_n _f_o_r _a _t._t_e_s_t

_D_e_s_c_r_i_p_t_i_o_n:

     'ttest' returns a function of one argument with bindings for 'cov'
     and 'p'. The function, when evaluated, performs a t-test using
     'cov' as the covariate. It returns 'TRUE' if the p value for a
     difference in means is less than 'p'.

_U_s_a_g_e:

     ttest(m, p=0.05, na.rm=TRUE)

_A_r_g_u_m_e_n_t_s:

       m: If 'm' is of length one then it is assumed that elements one
          through 'm' of 'x' will be one group. Otherwise 'm' is
          presumed to be the same length as 'x' and constitutes the
          groups.

       p: The p-value for the test. 

   na.rm: If set to 'TRUE' any 'NA''s will be removed. 

_D_e_t_a_i_l_s:

     When the data can be split into two groups (diseased and normal
     for example) then we often want to select genes on their ability
     to distinguish those two groups. The t-test is well suited to this
     and can be used as a filter function.

     This helper function creates a t-test (function) for the specified
     covariate and considers a gene to have passed the filter if the
     p-value for the gene is less than the prespecified 'p'.

_V_a_l_u_e:

     'ttest' returns a function with bindings for 'm' and 'p' that will
     perform a t-test

_A_u_t_h_o_r(_s):

     R. Gentleman

_S_e_e _A_l_s_o:

     'kOverA', 'Anova', 't.test'

_E_x_a_m_p_l_e_s:

       dat <- c(rep(1,5),rep(2,5))
       set.seed(5)
       y <- rnorm(10)
       af <- ttest(dat, .01)
       af(y)
       af2 <- ttest(5, .01)
       af2(y)
       y[8] <- NA
       af(y)
       af2(y)
       y[1:5] <- y[1:5]+10
       af(y)

