Skip to content

a question about sort and BH

3 messages · chunjiang he, R. Michael Weylandt

#
On Mon, Oct 3, 2011 at 10:08 PM, chunjiang he <camelbbs at gmail.com> wrote:
Suppose your data is "d": then try which(d[,3] < 0.05)
# Just the same as seq(lp, 1 , by = -1)
# pmin does parallel minimums, p[o] is the same as sort(p) and
ordering by [ro] puts the outputted values in reverse order than the
went in.

As an exercise, I'd suggest you get the original paper, see how the
calculation is done there, implement it in R as best you can, even if
it seems loop-y, and refine it down to R Core's implementation. One of
the best ways I know to learn to think vectorwise.

Sorry I can't help more, but I don't know the method so I dont want to
read too much into the code and say something that I havent thought
through (Lord knows I do that enough on this list!!)

Michael