p.adjust.w {someMTP}R Documentation

Adjust P-values for Multiple Comparisons

Description

Given a set of p-values, returns p-values adjusted using one of several (weighted) methods. It extends the method of p.adjust{stats}

Usage

p.adjust.w(p, method = c("bonferroni","holm","BHfwe","BH","BY"), n = length(p),w=NULL)

Arguments

p

vector of p-values (possibly with NAs)

method

correction method

n

number of comparisons, must be at least length(p); only set this (to non-default) when you know what you are doing!

w

weigths to be used. p.adjust.w(..., rep(1,length(p))) produces the same results as in p.adjust(...) (i.e. the unweighted counterpart).

Value

A vector of corrected p-values (same length as p) having two attributes: attributes(...)$w is the vecotr of used weights and attributes(...)$method is the method used.

Author(s)

Livio Finos

References

Benjamini, Hochberg (1997). Multiple hypotheses testing with weights. Scand. J. Statist. 24, 407-418.

Finos, Salmaso (2007). FDR- and FWE-controlling methods using data-driven weights. Journal of Statistical Planning and Inference, 137,12, 3859-3870.

See Also

p.adjust

Examples

set.seed(13)
y <- matrix(rnorm(5000),5,1000) #create toy data
y[,1:100] <- y[,1:100]+3 #create toy data

p <- apply(y,2,function(y) t.test(y)$p.value) #compute p-values
M2 <- apply(y^2,2,mean) #compute ordering criterion

fdr   <- p.adjust(p,method="BH") #(unweighted) procedure, fdr control
 sum(fdr<.05)
fdr.w <- p.adjust.w(p,method="BH",w=M2) #weighted procedure, weighted fdr control
 sum(fdr.w<.05)
 
fwer   <- p.adjust(p,method="holm") #(unweighted) procedure, fwer control
 sum(fwer<.05)
fwer.w <- p.adjust.w(p,method="BHfwe",w=M2) #weighted procedure, weighted fwer (=fwer) control
 sum(fwer.w<.05)

plot(M2,-log10(p))

[Package someMTP version 1.4.1.1 Index]