comp.fdr                package:DEDS                R Documentation

_C_o_m_p_u_t_i_n_g _p_e_r_m_u_t_a_t_i_o_n _b_a_s_e_d _q _v_a_l_u_e_s _c_o_n_t_r_o_l_l_i_n_g _f_a_l_s_e _d_i_s_c_o_v_e_r_y
_r_a_t_e _f_o_r _e_a_c_h _r_o_w _o_f _a _m_a_t_r_i_x

_D_e_s_c_r_i_p_t_i_o_n:

     This function computes permuation based q values for a selected
     test statistic, e.g., one- or two-sample t-statitics,
     F-statistics, SAM, Fold change, moderated t-statistics and
     moderated F-statisitcs, for each row of a matrix.

_U_s_a_g_e:

     comp.fdr(X, L, B = 1000, test = c("t", "fc", "sam", "f", "modt", "modf"), tail = c("abs", "lower", "higher"), extra = NULL)

_A_r_g_u_m_e_n_t_s:

       X: A  matrix, with m rows corresponding to variables
          (hypotheses) andn columns corresponding to observations. In
          the case of gene expression data, rows correspond to genes
          and columns to mRNA samples. The data can be read using
          'read.table'. 

       L: A vector of integers corresponding to observation (column)
          class labels. For k classes, the labels must be integers
          between 0 and k-1. 

       B: The number of permutations. For a complete enumeration, 'B'
          should be 0 (zero) or any number not less than the total
          number of permutations. 

    test: A character string specifying the statistic to be used to
          test the null hypothesis of no association between the
          variables and the class labels.
           If 'test="t"', for one-class, the tests are based on
          one-sample t-statistics; for two-class, the tests are based
          on two-sample t-statistics (unequal variances).  
           If 'test="f"', the tests are based on F-statistics.
           If 'test="fc"', the tests are based on fold changes among
          classes.
           If 'test="sam"', the tests are based on SAM-statistics.
           If 'test="modt"', the tests are based on moderated
          t-statistics.
           If 'test="modf"', the tests are based on moderated
          F-statistics. 

    tail: A character string specifying the type of rejection region.
           If 'side="abs"', two-tailed tests, the null hypothesis is
          rejected for large absolute values of the test statistic.
           If 'side="higher"', one-tailed tests, the null hypothesis is
          rejected for large values of the test statistic.
           If 'side="lower"', one-tailed tests,  the null hypothesis is
          rejected for small values of the test statistic. 

   extra: Extra parameter need for the test specified; see
          'deds.genExtra'.

_D_e_t_a_i_l_s:

_V_a_l_u_e:

     A matrix of the following columns: 

   order: order of rows (genes) based on statistics.

    stat: a vector of statistics.

 unadj.p: a vector of unadjusted p values.

 qvalues: a vector of q values.

_A_u_t_h_o_r(_s):

     Yuanyuan Xiao, yxiao@itsa.ucsf.edu, 
      Jean Yee Hwa Yang, jean@biostat.ucsf.edu.

_R_e_f_e_r_e_n_c_e_s:

     Storey, J.D. (2003) The positive False Discovery Rate: A Bayesian
     Interpretation and the q-value. _Annals of Statistics_,
     31:2013-2035.

_S_e_e _A_l_s_o:

     'comp.unadjp', 'comp.adjp', 'comp.stat'

_E_x_a_m_p_l_e_s:

     X <- matrix(rnorm(1000,0,0.5), nc=10)
     L <- rep(0:1,c(5,5))

     # genes 1-10 are differentially expressed
     X[1:10,6:10]<-X[1:10,6:10]+1

     # t statistics
     unadjp.t <- comp.fdr(X, L, test="t")

