Hi,
Im just trying to get my head around Benjamini + Hochberg multiple testing using the p.adjust approach in R. So is the BH mutliple testing option (pval *no of tests)/rank ?
I have a dummy dataset and bonferroni multiple testing works as should
pvals = c(2.335810e-07, 4.820826e-07, 4.820826e-07, 5.807533e-07, 5.807533e-07,6.954857e-07)
pval2=as.numeric(pvals)
BONF = p.adjust(pval2, "bonferroni")
head(BONF)
[1] 1.401486e-06 2.892496e-06 2.892496e-06 3.484520e-06 3.484520e-06
[6] 4.172914e-06
However, when I try the Benjamini and Hochberg option the adjusted pvalues are all the same
BH = p.adjust(pval2, "BH")
head(BH)
[1] 6.954857e-07 6.954857e-07 6.954857e-07 6.954857e-07 6.954857e-07
[6] 6.954857e-07
If there is any advice on what Im doing wrong it would be much appreciated or if anybody knows the exact formula p.adjust uses for BH as well.
Thanks
p.adjust does not use your
q
.I also don't understand your comment on subtracting out a uniform distribution, or the "excess significance".
The adjusted p-value is simply the minimum FDR under which the test is significant.
It looks like I had the BY method rather than BH, I'll update the answer to correct that.
Regarding subtracting out a uniform, that's one of the ways of conceptually understanding how BH works.