Learn R Programming

flip (version 2.0)

npc: Functions for multiplicity corrections

Description

npc provides overall tests (i.e. weak FWER control), while flip.adjust provides adjusted p-values (i.e. strong FWER control).

Usage

npc(permTP, comb.funct = c(flip.npc.methods, p.adjust.methods), 
          subsets=NULL,weights=NULL, stdSpace=FALSE, ...)
flip.adjust(permTP, method = flip.npc.methods, maxalpha = 1, 
          weights = NULL, stdSpace=FALSE, ...)

flip.npc.methods 
#    c("Fisher", "Liptak", "minP", "maxT", "maxTstd", "sumT", "sumT2")

Arguments

permTP
A permutation space (B times m matrix) or an flip.object as produced by flip. Alternatively it can be a flip.object-class resulting, for
comb.funct
A combining function flip.npc.methods: "Fisher", "Liptak", "minP" (i.e. Tippet), "maxT", "sumT" (i.e. direct) , "sumT2" (sum of T^2). "Fisher" combining function is the default. See also the section Details.
method
A method among flip.npc.methods or p.adjust.methods. By default "maxT" is used. See also the section Details.
maxalpha
Adjusted p-values greater than maxalpha are forced to 1. It saves computational time when there are many hypotheses under test.
weights
Optional argument that can be used to give certain variables greater weight in the combined test. Can be a vector or a list of vectors. In the latter case, a separate test will be performed for each weight vector. If both subsets and
subsets
Optional argument that can be used to test one or more subsets of variables. Can be a vector of column names or indices of a flip.object-class, or a list of such vectors. In the latter cas
stdSpace
Ask if the permutation distribution of the test statistic should be standardized or not. The default is FALSE. The option is applied only if comb.funct or method is equal to "maxT" or "sumT"
...
further arguments

Value

Details

npc combine the p-values using the combining functions (and the method) described in Pesarin (2001). It make use of the join space of the permutations. This is usually derived from a call of flip function. flip.adjust adjusts the p-value for multiplicity (FamilyWise Error Rate). When method is equal to "maxT", "maxTstd" (i.e. max T on scale(permTP)) or "minP" (i.e. Tippett) it performs the step-down method of Westfall and Young (1993). For any other element of flip.npc.methods (i.e. "Fisher", "Liptak", "sumT" (i.e. direct) or "sumT2" (sum of T^2)) a call to npc together with a closed testing procedure is used (it make use of cherry:closed). When method is any among p.adjust.methods the function stats:p.adjust or -if weights are provided- someMTP:p.adjust.w is used.

References

Pesarin (2001) Multivariate Permutation Tests with Applications in Biostatistics. Wiley, Mew York. P. H. Westfall and S. S. Young (1993). Resampling-based multiple testing: Examples and methods for p-value adjustment. John Wiley & Sons.

Examples

Run this code
Y=data.frame(matrix(rnorm(50),10,5))
names(Y)=LETTERS[1:5]
Y[,1:2]=Y[,1:2]+1.5
res = flip(Y,perms=10000)

########npc
p2=npc(res,"minP")
summary(p2)
p2=npc(res,"Fisher",subsets=list(c1=c("A","B"),c2=names(Y)))
summary(p2)
p2=npc(res,"Fisher",subsets=list(c1=c("A","B"),c2=names(Y)),weights=1:5)
summary(p2)



flip.adjust(res,"maxT")

flip.adjust(res,"BH")
##same as 
#p.adjust(res,"BH")

Run the code above in your browser using DataLab