1

I am trying to use the R package multtest to adjust a list of p-values for multiple testing. However, multtest will only return a list of "1" characters of equal length to the list of p-values that were analyzed.

The input file is a text file in which the pvalues are separated by newline characters. A segment of the file is reproduced below:

0.182942602
0.333002877
0.282000206
0.161501682
0.161501682  

I downloaded the multtest package (multtest_2.14.0) from Bioconductor, and am running it in R version x64 2.15.2. Does anyone know if there is a compatibility problem between multtest and R 2.15.2?

My code:

library(multtest, verbose = FALSE)
table1 <- read.table("p-values.txt", header = FALSE, colClasses = "double")
table2 <-as.vector(as.double(table1[,1]))
results<-p.adjust(table2, method = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"))
write.table(results, file = "output.txt")
David Robinson
  • 77,383
  • 16
  • 167
  • 187
gwilymh
  • 415
  • 1
  • 7
  • 20
  • Are you sure that a vector of 1s is not the correct adjustment? How long is your input vector of p-values, and what is the smallest one? (If the smallest value is larger than `1/n`, where `n` is the number of p-values, then a Bonferroni correction would indeed lead to a vector of 1s) – David Robinson Mar 14 '13 at 14:46
  • (Also, why are you passing it multiple methods? It only takes one argument of a method, so in this case it would use the first one, Holm). – David Robinson Mar 14 '13 at 14:56

1 Answers1

1

This is not an error- this is the correct adjustment when there are no p-values that can be considered significant within that vector of p-values.

Your code performs the Holm correction (method takes only one argument, and in this case will use the "holm" method, the first item in your vector). The Holm method will correctly return all ones in the case that

min(p) * length(p) > 1

In that situation (using this multiple hypothesis testing framework), there are no p-values in the vector that can be considered significant.


If you'd like to see the gory details, the code for the holm method (taken directly from the multtest package) is

i <- seq_len(lp)
o <- order(p)
ro <- order(o)
pmin(1, cummax((n - i + 1L) * p[o]))[ro]

where p is the input vector, and lp and n are the length of the vector. That expression (n - i + 1L) * p[o] is saying "for each item in the sorted list, take n+1 minus its index, then multiply it by the value". For the minimum item, that is (n + 1 - 1) * min(p) -> n * min(p). The cummax means the cumulative maximum- which means that none of the subsequent items can be smaller than the first value. And pmin(1, ...) means that for every item in the vector, if the item is greater than 1, set the value equal to 1 (since a p-value about 1 is meaningless).

This means that if n * min(p) is greater than one, then the adjusted p-value of the smallest item is 1, which means the adjusted p-value of every item must be 1.

David Robinson
  • 77,383
  • 16
  • 167
  • 187