TailPP                 package:BGmix                 R Documentation

_T_a_i_l _p_o_s_t_e_r_i_o_r _p_r_o_b_a_b_i_l_i_t_y _f_o_r _B_G_m_i_x _o_u_t_p_u_t.

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

     For differential expression models with unstructured priors (no
     mixture prior), calculates tail posterior probabality and FDR, and
     plots a histogram. Uses whole posterior distributions of
     likelihood parameters (found by 'ccTrace') and posterior means of
     hyperparameters (found by 'ccParams').

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

     TailPP(res, nreps, params, paired=F, alpha=0.05, N = 5000, prec=0.05, p.cut = 0.7, plots  = T, plot.pi0=F)

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

     res: list object output from 'ccTrace'

   nreps: vector length 2 containing the number of replicates in each
          condition

  params: list object output from 'ccParams'

  paired: logical. TRUE for paired design, FALSE for unpaired.

   alpha: parameter of the tail posterior probability (1-alpha/2
          quantile)

       N: simulation size for tail posterior probability under H0

    prec: parameter used when estimating CDF of tail posterior
          probability under H0 

   p.cut: calculate FDR only for cutoffs on tail posterior probability
          > p.cut 

   plots: logical. if TRUE, makes plots of the histogram of tail
          posterior probability with the null density  and of FDR 

plot.pi0: logical. if TRUE, diagnostic plot of the estimated pi0 at
          different locations and the median estimate 

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

    tpp : vector of tail posterior probabilities with parameter alpha,
          one per gene

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

    pi0 : estimated proportion of observations under the null

    pp0 : simulations under the null

_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. 
     http://www.blackwell-synergy.com/doi/abs/10.1111/j.1541-0420.2006.00807.x

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

     '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)
      histTailPP(tpp.res)
      FDRplotTailPP(tpp.res, plot.TP = TRUE)

