Skip to content
Prev 255754 / 398506 Next

Adjusting p values of a matrix

On Apr 4, 2011, at 17:02 , January Weiner wrote:

            
I don't think there's a really elegant way (have a look inside pairwise.table if you care).

If you start one step further back, you could just use pairwise.table with a suitably defined comparison function. Otherwise, how about

ltri <- lower.tri(pmat)
utri <- upper.tri(pmat)
pmat[ltri] <- p.adjust(pmat[ltri], method = "fdr")
pmat[utri] <- t(pmat)[utri]