# calcFDR

From BGmix v1.32.0
by Alex Lewin

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

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.

- Keywords
- htest

##### 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?

##### 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

##### Examples

```
## 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)
```

*Documentation reproduced from package BGmix, version 1.32.0, License: GPL-2*

### Community examples

Looks like there are no examples yet.