npc provides overall tests (i.e. weak FWER control), while
flip.adjust provides adjusted p-values (i.e. strong FWER control).
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, ...)
The function returns an object of class
flip.object-class (and the use of
getFlip(obj,"Adjust").
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 example from a call of
function flip.
A method among flip.npc.methods or
p.adjust.methods. By default "maxT" is used. See also
the section Details.
Adjusted p-values greater than maxalpha are forced to
1. It saves computational time when there are many hypotheses under test.
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 weights are specified as a list,
they must have the same length. In that case, weights vectors may
have either the same length as the number of covariates in
alternative, or the same length as the corresponding subset vector.
Weights can be negative; the sign has no effect unless directional is
TRUE. It works for npc and flip.adjust with
method= "maxT", "maxTstd" or "minP"
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", it becomes useful when test statistics are of different
nature (e.g. chisquare and t-test).
further arguments. Among them, tail can be used to set the
tail of the alternative for the permTP (see also flip).
The arguments statTest, fastSumCombination and linComb
are used in objects flipMix and comb.funct=
"data.sum","data.linComb","data.pc" or "data.trace".
A combining function flip.npc.methods (all but
"kfwer"): "Fisher", "Liptak", "MahalanobisT" , "MahalanobisP" (i.e. related
to Hotelling T2), "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.
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 (names(flipObject)), or a list of
such vectors. In the latter case, a separate test will be performed for
each subset. Only for
comb.funct %in% c("data.sum","data.linComb","data.pc","data.trace") the
names refers to the columns of Y data
colnames(flipObject@data$Y) .
livio finos, Florian Klinglmueller and Aldo Solari.
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.
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.
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")
Run the code above in your browser using DataLab