locfdr                package:locfdr                R Documentation

_C_o_m_p_u_t_a_t_i_o_n _o_f _L_o_c_a_l _F_a_l_s_e _D_i_s_c_o_v_e_r_y _R_a_t_e_s

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

     Compute local false discovery rates, following the definitions and
     description in Efron (2004) JASA, Volume 99, pages 96-104.

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

     locfdr(zz, bre = 120, df = 7, pct = 1/1000, pct0 = 2/3, nulltype = 1, type = 0)

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

      zz: A vector of summary statistics, one for each case under
          simultaneous consideration. In a microarray experiment there
          would be one component of zz for each gene, perhaps a
          t-statistic comparing gene expression levels under two
          different conditions. The calculations assume a large number
          of cases, say at least length(zz) > 100.   

     bre: Number of breaks in the discretization of the z-score axis,
          set to 120 by default. This can also be a vector of
          breakpoints fully describing the discretization.  

      df: Number degrees of freedom for fitting the estimated density
          f(z), set to 7 by default. 

     pct: Excluded tail proportions of zz's when fitting f(z);
          pct=1/1000 by default; pct=0 includes full range of zz's; pct
          can also be a 2-vector, describing the fitting range. 

    pct0: Included proportion of range used in fitting null density
          f0(z); default value is 2/3. 

nulltype: Type of null hypothesis assumed in estimating f0(z); 0 is
          theoretical null N(0,1) [which assumes that the original zz
          scores have been scaled to have a N(0,1) distribution under
          the null hypothesis]; 1 is the empirical null [which assumes
          a N(a,b) null hypothesis, with a=zmax and b=sig2 estimated
          from the central part of the f(z) fit]; 2 is a "split normal"
          version of 1 in which the f0(z) is allowed to have different
          scales on the two sides of the maximum.] The default is
          nulltype=1. 

    type: Type of fitting used for f(z); 0 is a natural spline, 1 is a
          polynomial, in either case with degrees of freedom df [so
          total degrees of freedom df+1 including the intercept.] The
          default is type=0.  

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

     A list with three components.

     fdr: the estimated local false discovery rates for each case

   f0.p0: The estimated mean and variance(s) for f0(z) assuming
          nulltype 1 or 2, and also the estimated proportion p0 of null
          cases

     mat: A matrix summarizing the estimates of f(z), f0(z), fdr(z),
          etc. at the midpoints "z" of the break discretization. These
          are convenient for comparisons and plotting; mat includes fdr
          from nulltype 1 or 2 as specified, estimates of the usual
          tail-area False Discovery Rates, Fdrleft and Fdrright, and
          also fdrtheo and f0theo if nulltype=0 is specified.

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

     Bradley Efron

_R_e_f_e_r_e_n_c_e_s:

     Efron, B. (2004) _Large-scale simultaneous hypothesis testing: the
     choice of a null hypothesis_, JASA, Vol. 99, pp 96-104

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

     ## HIV data example
     data(hivdata)
     w <- locfdr(hivdata)
     print(w)

     ## Second Simulation Example

