Hi!
I want to calculate the p.adjusted p-value for all genes in my dataset. I have a total of 3294 genes with p.vlue <= 0.05 but when I try to calculate the adjusted p-value all I get is just 1 for all genes. what am I doing wrong?
here me code (shown only for those 3194 genes but it gives me the same results also if I do it on the unfiltered dataset):
#load dataset # not shown
library(dplyr)
#FILTER pvalue <= 0.05
test_pvalue <- filter(test, test$p_value <= 0.05 ) #3284 total genes with p.value <= 0.05
#pvalue
pvalue <- test_pvalue$p_value #select column of p.value
f1 <- p.adjust(pvalue,method="bonferroni")
and I got this result (just the few 30 rows printed):
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[23] 1 1 1 1 1 1 1 1
I followed this padjusted
What am I doing wrong? Is something that am I missing?
thank you for the help!
Camilla
Yes. You shouldn't assume that because you have p-values below 0.05, adjusted ones will still be below 0.05. It's perfectly possible for adjusted p-values to be (all) 1, in particular if you choose the most conservative method of correction. Also before you try to adjust your p-values, check the distribution of the original p-values. See How to interpret a p-value histogram
thank you very much! I will !