Skip to content
Prev 327197 / 398502 Next

BH correction with p.adjust

On Jul 21, 2013, at 15:02 , Scott Robinson wrote:

            
Comparing the same method might help!
[1] 0.0150 0.5000 0.0003
You have the source code, how about reading it?

    }, BH = {
        i <- lp:1L
        o <- order(p, decreasing = TRUE)
        ro <- order(o)
        pmin(1, cummin(n/i * p[o]))[ro]
    }

Notice the cumulative minimum. The first element in n/i*p[o] is going to be p[n] == 0.1 (since your p is in ascending order). So no element of the result is going to be bigger than 0.1. (I presume this is because p-adjustments must be order-preserving.)