[R] adjusted p value, fdr

Jim Lemon drj|m|emon @end|ng |rom gm@||@com
Tue Jan 7 23:36:45 CET 2020


Hi Anamarija,
In the first calculation you are implicity using n=15568 as the
default as the number of p values tested.

> p.adjust(pval,method="BH",n=15568)
[1] 0.4782784 0.5852553 1.0000000 1.0000000

If all of your t-tests are related, say by testing the location values
for each row against a fixed value like zero, then this is an
appropriate way to discover whether any differ significantly from your
reference value. In general if you only want to test a subset of the
rows rather than all, you should have a good reason for doing so.

Jim

On Wed, Jan 8, 2020 at 9:15 AM Ana Marija <sokovic.anamarija using gmail.com> wrote:
>
> Hello,
>
> I have a data set which has 15568 entries
>
> I am trying to calculate adjusted p values using p value via:
>
> head(x1g)
>
>                                                    t      P.Value
>       adj.P.Val          B       fdr
> 3TXADqtSkhV1IXRHlg  4.468671 3.072189e-05 0.4782784  1.5253151 0.4782784
> 34lG83aZ6.WLFnge6s  4.217037 7.518696e-05 0.5852553  0.8660534 0.5852553
> oS67lguv5HpU4i6Pvg -3.939182 1.959413e-04 0.9994637  0.1600655 0.9994637
> Qpc2sX7gp.W5E2rRS4  3.732914 3.900822e-04 0.9994637 -0.3471331 0.9994637
> NqsVOy_yos30cOQRSE -3.673551 4.737810e-04 0.9994637 -0.4902001 0.9994637
> B3SDpegGjpdxnvU0S0 -3.665765 4.859528e-04 0.9994637 -0.5088638 0.9994637
>
> x1g$fdr=p.adjust(x1g$P.Value,method="BH")
>
> the fdr values seem unusually high
>
> if I just do it for the first few p values from my x1g data frame:
> >pval=c(3.072189e-05,7.518696e-05,1.959413e-04,3.900822e-04)
> > p.adjust(pval,method="BH")
> [1] 0.0001228876 0.0001503739 0.0002612551 0.0003900822
>
> Can someone please explain what might be the issue.
>
> Thanks
> Ana
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list