- benjamini-hochberg-adjust p-valuesprocedure
Returns the Benjamini-Hochberg (1995) adjusted p-values as a list, in the order of the input; the result is the same as that of p.adjust(p, "BH") in R. With m p-values sorted from smallest to largest, the k-th one is multiplied by m / k and capped at 1, and a running minimum taken from the largest down then keeps the adjusted values in the same order as the raw ones. Rejecting the hypotheses whose adjusted p-value is at most alpha keeps the false discovery rate (the expected share of false rejections among all rejections) at or below alpha for independent tests. It rejects at least as many hypotheses as the Holm procedure. Exact inputs give exact results.
> (benjamini-hochberg-adjust '(1/100 4/100 3/100 5/1000)) (1/50 1/25 1/25 1/50)