View source: R/groupedBerger.R
groupedBerger | R Documentation |
Combine p-values from grouped tests with Berger's intersection-union test (IUT). Groups are defined according to unique levels of a grouping factor.
groupedBerger(p.values, grouping, log.p = FALSE)
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 |
log.p |
Logical scalar indicating whether the p-values in |
The joint null hypothesis for each group is that any of the individual null hypotheses are true. Berger's IUT will only reject the joint null if all of the individual nulls are rejected. This method is applicable under arbitrary dependency structures. No weights are considered.
The representative test for each group is defined as the test with the largest p-value, as this is ultimately used as the IUT p-value. All tests for each group are considered to be influential as increasing any of them (e.g., to unity) would result in a larger combined p-value.
A list containing:
p.value
, a named numeric vector of length equal to the number of unique levels in grouping
.
This contains the IUT 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 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
Berger RL and Hsu JC (1996). Bioequivalence trials, intersection-union tests and equivalence confidence sets. Statist. Sci. 11, 283-319.
parallelBerger
, for a version that operates on parallel vectors of p-values.
p1 <- rbeta(100, 0.8, 1)
g <- sample(10, length(p1), replace=TRUE)
# Standard application:
out <- groupedBerger(p1, g)
str(out)
# With log p-values.
out <- groupedBerger(log(p1), g, log.p=TRUE)
str(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.