[R] p.adjust with "hommel" method doesn't allow NAs but other methods do?

Earl F. Glynn efg at stowers-institute.org
Fri Oct 22 00:11:21 CEST 2004

Is this expected behavior?

I've got 77 NAs in a vector of 6875 p values:

# Hommel method fails
> p <- p.adjust(r$p,"hommel")
Error: NAs are not allowed in subscripted assignments
In addition: Warning message:
longer object length
        is not a multiple of shorter object length in: n * p/(1:n)

# These work fine
> p <- p.adjust(r$p,"none")
> p <- p.adjust(r$p,"bonferroni")
> p <- p.adjust(r$p,"holm")
> p <- p.adjust(r$p,"hochberg")
> p <- p.adjust(r$p,"fdr")

> sum(is.na(r$p))
[1] 77
> length(r$p)
[1] 6875

When I removed these NAs myself, why does the "hommel" method take perhaps
300 times (or more) longer than the other methods?  The Hommel method took
over 5 minutes for this set of 6875 when the other methods were less than a

I'm using Windows 2000 and R 2.0.0


More information about the R-help mailing list