combineGroupedPValues {metapod} | R Documentation |
Combine p-values from grouped hypothesis tests using a variety of meta-analysis methods. Each group of p-values is defined as those assigned to the same level of the grouping factor.
combineGroupedPValues( p.values, grouping, method = c("simes", "holm-min", "berger", "fisher", "pearson", "wilkinson", "stouffer"), weights = NULL, log.p = FALSE, min.n = 1, min.prop = 0.5 )
p.values |
A numeric vector containing p-values for individual tests. |
grouping |
A vector or factor of length equal to Alternatively, an rle object where each run corresponds to a group and specifies the entries of |
method |
String specifying the method to use to combine p-values. |
weights |
A numeric vector of length equal to |
log.p |
Logical scalar indicating whether the p-values in |
min.n |
Integer scalar specifying the minimum number of individual nulls to reject when testing the joint null. |
min.prop |
Numeric scalar in [0, 1], specifying the minimum proportion of individual nulls to reject when testing the joint null. |
min.prop
and min.n
only have an effect for method="wilkinson"
and "holm-min"
.
weights
only has an effect for method="simes"
, "holm-min"
and "stouffer"
.
A list containing:
p.value
, a named numeric vector of length equal to the number of unique levels in grouping
.
This contains the combined p-value for each group, log-transformed if log.p=TRUE
.
Each entry is named according to the group.
representative
, a named integer scalar specifying the index of representative test for each group.
Each index refers to an entry of p.values
and is named according to its group.
influential
, a logical vector of length equal to p.values
.
Entries are TRUE
for any p-value that is deemed “influential” to the final combined p-value for its group.
Aaron Lun
p <- runif(10000) g <- sample(100, 10000, replace=TRUE) fish <- combineGroupedPValues(p, g, method="fisher") hist(fish$p.value) z <- combineGroupedPValues(p, g, method="stouffer", weights=rexp(10000)) hist(z$p.value) simes <- combineGroupedPValues(p, g, method="simes") hist(simes$p.value) berger <- combineGroupedPValues(p, g, method="berger") hist(berger$p.value)