FDRforTailPP: FDR for tail posterior probability

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/FDRforTailPP.R

Description

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

Usage

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

Arguments

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

Value

pi0

estimate of pi0 - proportion of non-differentially expressed genes

FDR

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

Author(s)

Natalia Bochkina

References

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

See Also

TailPP, FDRplotTailPP,histTailPP,EstimatePi0

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 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)

BGmix documentation built on Nov. 8, 2020, 4:54 p.m.