Given a list of p-values, this function conducts multiple testing and outputs the indices of the rejected hypothesis. Uses an adaptive Benjamini-Hochberg (BH) procedure where the proportion of true nulls \(\pi_0\) is estimated. This estimation is done based on the pi0est function in the qvalue package. See Storey(2015).
farm.FDR(pvalue, alpha = NULL, type = c("mBH", "BH"), lambda = seq(0.05,
0.95, 0.05), pi0.method = c("smoother", "bootstrap"), smooth.df = 3,
smooth.log.pi0 = FALSE)
a vector of p-values obtained from multiple testing
an optional significance level for testing (in decimals). Default is 0.05. Must be in \((0,1)\).
an optional character string specifying the type of test. The default is the modified BH procedure (type = "mBH"). The usual BH procedure is also available (type = "BH"). See Benjamini and Hochberg (1995).
an optional threshold for estimating the proportion of true null hypotheses \(\pi_0\). Must be in \([0,1)\).
optional, either "smoother" or "bootstrap"; the method for automatically choosing tuning parameter in the estimation of \(\pi_0\), the proportion of true null hypotheses.
an optional number of degrees-of-freedom to use when estimating \(\pi_0\) with a smoother.
an optional TRUE/FALSE. If TRUE and pi0.method = "smoother", \(\pi_0\) will be estimated by applying a smoother to a scatterplot of \(\log(\pi_0)\) estimates against the tuning parameter lambda. Default is FALSE.
the indices of rejected hypotheses, along with their corresponding p values, and adjusted p values, ordered from most significant to least significant
all the indices of the tested hypotheses, along with their corresponding p values, adjusted p values, and a column with 1 if declared siginificant and 0 if not
The number of hypotheses rejected
The "mBH" procedure is simply the regular Benjamini-Hochberg pocedure, but in the rejection threshold the denominator \(p\) is replaced by \(\pi_0 * p\). This is a less conservative approach. See Storey (2002).
Benjamini, Y. and Hochberg, Y. (1995). "Controlling the False Discovery Rate: A Practical and PowerfulApproach to Multiple Testing." Journal of the Royal Statistical Society B, 51, 289<U+2013>300.
Storey, J.D. (2015). "qvalue: Q-value estimation for false discovery rate control. R package version 2.8.0, https://github.com/jdstorey/qvalue.
Storey, J.D. (2002). " Direct Approach to False Discovery Rates." Journal of the Royal Statistical Society B, 64(3), 479<U+2013>498.
# NOT RUN {
set.seed(100)
Y = matrix(rnorm(1000, 0, 1),10)
pval = apply(Y, 1, function(x) t.test(x)$p.value)
farm.FDR(pval, 0.05)
farm.FDR(pval, 0.01, type = "BH")
# }
Run the code above in your browser using DataLab