| flip.adjust {flip} | R Documentation |
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
flip.adjust(permTP, method = flip.npc.methods, maxalpha = 1,
weights = NULL, stdSpace = FALSE, ...)
npc(permTP, comb.funct = c(flip.npc.methods, p.adjust.methods),
subsets = NULL, weights = NULL, stdSpace = FALSE, ...)
Arguments
permTP |
A permutation space (B times m matrix) or an
|
method |
A method among |
maxalpha |
Adjusted p-values greater than |
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 |
stdSpace |
Ask if the permutation distribution of the test statistic
should be standardized or not. The default is |
... |
further arguments. Among them, |
comb.funct |
A combining function |
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
|
Details
npc combines the p-values using the combining functions (and the
method) described in Pesarin (2001). It makes use of the join space of the
permutations. This is usually derived from a call of flip function or
flipMixWithin.
Very shortly: "Fisher" =-sum log(p-values) "Liptak" =sum
qnorm(p-values) "MahalanobisT" = Mahalanobis distance of centered
matrix permTP (or permTP@permT ) "MahalanobisP" = same
as above, but using scores defined by qnorm(p-values) (tails are forced to
be one-sided) "minP" = "Tippett" = min(p-values) \
"maxT" = max(test statistics) "maxTstd" = max(standardized
test statistics) "sumT" = sum (test statistics) "sumTstd"
= sum (standardized test statistics) "sumT2" = sum (test
statistics)^2. The followings have to be used carefully and only with
objects from function flipMix: "data.sum" = sum of all columns of
Y, "data.linComb" = sum of all columns of Y (includes a vector or
matrix linComb among the arguments), "data.pc" = extracts the
first Principal component from the covariance matrix (you may also include a
vector whichPCs indicating which PCs you want to consider)\
"data.trace" = Extends the Pillai Trace, use parametric bootstrap to
asses the significance."kfwer" = can be only used with
flip.adjust (not in npc). It requires an extra parameter
k (k=11 by default).
flip.adjust adjusts the p-value for multiplicity (FamilyWise Error
Rate -FWER- and kFWER). 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. To perform control
of the kFWER use flip.adjust with method="kfwer" and extra
parameter k.
Value
The function returns an object of class
flip.object-class (and the use of
getFlip(obj,"Adjust").
Author(s)
livio finos, Florian Klinglmueller and Aldo Solari.
References
Pesarin (2001) Multivariate Permutation Tests with Applications in Biostatistics. Wiley, New York.
P. H. Westfall and S. S. Young (1993). Resampling-based multiple testing: Examples and methods for p-value adjustment. John Wiley & Sons.
Examples
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) # same as p2=npc(res,"Fisher")
summary(p2)
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)
res=flip.adjust(res, method="maxT")
#res=flip.adjust(res,"BH")
##same as
#p.adjust(res,"BH")
## now try
getFlip(res,"Adjust")