calcFDR: Estimate the FDR (false discovery rate) and related...

Description Usage Arguments Details Value Author(s) Examples

Description

Given a threshold on the posterior probabilities, genes are declared as null or differentially expressed. For any given threshold, the FDR (false discovery rate) and FNR (false non-discovery rate) can be estimated using the posterior probabilities. Estimated numbers of false positives and false negatives are also output.

Usage

1
calcFDR(res, pcut = seq(0.01,0.5,0.01), true.z = NULL, q.print = F)

Arguments

res

list object output from ccParams (this includes the posterior classification probabilities)

pcut

scalar or vector of thresholds for which to estimate FDR etc.

true.z

vector of true classifications (if known, eg. for simulated data)

q.print

Print FDR etc. when pcut is a vector?

Details

If the true classification is known, it can be given as true.z, and the true FDR etc. for the threshold probability can be calculated.

Value

fdr.est, fnr.est

scalars or vectors of estimated FDR, FNR

fp.est, fn.est

scalars or vectors of estimated no. false positives, no. false negatives

fdr.true, fnr.true

scalars or vectors of true FDR, FNR

fp.true, fn.true

scalars or vectors of true no. false positives, no. false negatives

npos, nneg

scalars or vectors of no. declared positives, no. declared negatives

prob.class

posterior classification probabilites (from the 'res' object input to this function)

true.z

argument to function is output

pcut

argument to function is output

Author(s)

Alex Lewin

Examples

1
2
3
4
5
6
## Note this is a very short MCMC run!
## For good analysis need proper burn-in period.
data(ybar,ss)
outdir <- BGmix(ybar, ss, c(8,8), nburn=0, niter=100, nthin=1)
params <- ccParams(outdir)
fdr <- calcFDR(params)

Example output

Loading required package: KernSmooth
KernSmooth 2.23 loaded
Copyright M. P. Wand 1997-2009
[1] "Mixture prior on comp. 2"
[1] "delta ~ Gamma, MH"
[1] "eta (scale of Gamma) updated"
[1] "lambda (shape of Gamma) not updated"
[1] "Normal Likelihood"
[1] "tau ~ Gamma"
[1] "a (prior for tau) is updated"
[1] "trace output for parameters"
[1] "no trace for predicted data"
 Burn-in: 

 Main up-dates: 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 
[1] "Output directory is ./run.1"
[1] "got beta"
[1] "got sig2"
[1] "got zg"

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