pifdr {gQTLstats} | R Documentation

## utility for computing plug-in FDR

### Description

utility for computing plug-in FDR

### Usage

    pifdr( obs, perms, trimToUnit = TRUE, ... )
    pifdr2( obs, perms, trimToUnit = TRUE, expandPerms=TRUE, ... )

### Arguments

`obs` | observed association scores
`perms` | vector of association scores under permutation; length should be integer multiple of `length(obs)`
`trimToUnit` | logical, if TRUE, values greater than 1 are replaced by 1. Such values can occur, for example, with relatively small sample sizes.
`expandPerms` | With certain pair-specific filtering operations, the number of scores obtained after permutation may not be a multiple of the number of observed scores. If TRUE, the scores obtained under permutation are sampled with replacement to simplify computation of plug-in FDR.
`...` | extra arguments ignored

### Details

Revised 12/30/13 to employ hist() to rapidly bin the permuted values.

### Value

vector of plug-in FDR estimates congruent to `obs`

### References

Hastie Tibshirani and Friedman Elements of Statistical Learning ch 18.7

### Examples

    set.seed(1234)
    op = par(no.readonly=TRUE)
    par(mfrow=c(2,2))
    X = c(rchisq(30000,1),rchisq(300,10))
    Y = rchisq(30300*3,1)
    qqplot(Y, X, xlab="null", ylab="observed")
    hist(pp <- pifdr(X,Y), xlab="plug-in FDR", main=" ")
    library(multtest)
    rawp = 1-pchisq(X, 1)
    MT <- mt.rawp2adjp(rawp)
    MT2 = MT[[1]][order(MT[[2]]),]
    plot(MT2[,"BH"], pp, xlab="BH FDR", ylab="plug-in FDR")
    par(op)

[Package gQTLstats version 1.21.3 Index]