FDRforTailPP              package:BGmix              R Documentation

_F_D_R _f_o_r _t_a_i_l _p_o_s_t_e_r_i_o_r _p_r_o_b_a_b_i_l_i_t_y

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

     Calculate the false discovery rate (FDR) for the tail posterior
     probability

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

     FDRforTailPP(tpp, a1, a2 = NULL, n.rep1, n.rep2 = NULL, prec = 0.05, p.cut = 0.7, N = 10000, pp0=NULL, plot = T)

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

     tpp: vector of tail posterior probabilities 

      a1: posterior mean of the shape parameter of the inverse gamma
          distribution - prior for the variance in condition 1 

      a2: posterior mean of the shape parameter of the inverse gamma
          distribution - prior for the variance in condition 2 

  n.rep1: number of replicates in condition 1 

  n.rep2: number of replicates in condition 2 

    prec: precision of the estimate of the cumulative distribution
          function of tail posterior probability under H0 (at points 1
          - k*prec, k =1,2,..) 

   p.cut: to save time, calculate FDR only for cutoffs on tail
          posterior probability > p.cut 

       N: simulation size for tail posterior probability under H0 

     pp0: a vector of simulated tail posterior probabilities under H0 

    plot: if True, the estimated pi0 at different locations and the
          median estimate is plotted

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

     pi0: estimate of pi0 - proportion of non-differentially expressed
          genes

    FDR : estimate of FDR for all (distinct) cutoffs > p.cut

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

     Natalia Bochkina

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

     Bochkina N., Richardson S. (2007)  Tail posterior probability for
     inference in pairwise and multiclass gene expression data.
     Biometrics.

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

     'TailPP', 'FDRplotTailPP','histTailPP','EstimatePi0'

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

      data(ybar, ss)
      nreps <- c(8,8)

     ## Note this is a very short MCMC run!
     ## For good analysis need proper burn-in period.
      outdir <- BGmix(ybar, ss, nreps, jstar=-1, nburn=0, niter=100, nthin=1)

      params <- ccParams(outdir)  
      res <-  ccTrace(outdir)
       
      tpp.res <- TailPP(res, nreps, params, plots  = FALSE)
      FDR.res = FDRforTailPP(tpp.res$tpp, a1 = params$maa[1],
     a2 = params$maa[2], n.rep1=nreps[1], n.rep2=nreps[2], p.cut = 0.8)

