BGmix (version 1.32.0)

calcFDR: Estimate the FDR (false discovery rate) and related quantities for BGmix output.

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

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?

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

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.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab