Skip to content
Prev 366637 / 398502 Next

Qvalue package: I am getting back 1, 000 q values when I only want 1 q value.

What you're doing makes no sense.  Given p-values p_i, i=1...n, resulting
from hypothesis tests t_i, i=1...n, the q-value of p_i is the expected
proportion of false positives among all n tests if the significance level
of each test is ?=p_i. Thus a q-value is only defined for an observed
p-value.  Assuming that you have stored n observed p-values in an R vector
P, and the ith p-value P[i]==.05, then the R syntax to obtain the q-value
for P[i] is qvalue(P)$qvalues[i].

If, instead (as I suspect), that .05 is not among your observed p-values,
but you want to know what the FDR would be, given your sequence of
p-values, if the significance level of every test were .05, then the R
syntax would be
max(qvalue(P)$qvalues[P<=.05]).

On Fri, Jan 13, 2017 at 2:08 AM, Thomas Ryan <tombernardryan at gmail.com>
wrote: