groupedHolmMin: Combine grouped p-values with the minimum Holm approach

View source: R/groupedHolmMin.R

groupedHolmMinR Documentation

Combine grouped p-values with the minimum Holm approach

Description

Combine p-values from grouped tests with the minimum Holm approach. Groups are defined according to unique levels of a grouping factor.

Usage

groupedHolmMin(
  p.values,
  grouping,
  weights = NULL,
  log.p = FALSE,
  min.n = 1,
  min.prop = 0.5
)

Arguments

p.values

A numeric vector containing p-values for individual tests.

grouping

A vector or factor of length equal to p.values, specifying the group to which each test is assigned.

Alternatively, an rle object where each run corresponds to a group and specifies the entries of p.values belonging to that group. This assumes that p.values is ordered such that all entries in the same group are adjacent to each other.

weights

A numeric vector of length equal to p.values, containing a positive weight for each test. Alternatively NULL, in which case equal weights are assigned to all tests.

log.p

Logical scalar indicating whether the p-values in p.values are log-transformed.

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.

Details

Here, the joint null hypothesis for each group is that fewer than N individual null hypotheses are false. The joint null is only rejected if N or more individual nulls are rejected; hence the “minimum” in the function name.

N is defined as the larger of min.n and the product of min.prop with the number of tests in the group (rounded up). This allows users to scale rejection of the joint null with the size of the group, while avoiding a too-low N when the group is small. Note that N is always capped at the total size of the group.

To compute the combined p-value, we apply the Holm-Bonferroni correction to all p-values in the set and take the N-th smallest value. This effectively recapitulates the step-down procedure where we reject individual nulls until we reach the N-th test. This method works correctly in the presence of dependencies between p-values.

If non-equal weights are provided, they are used to effectively downscale the p-values. This aims to redistribute the error rate across the individual tests, i.e., tests with lower weights are given fewer opportunities to drive acceptance of the joint null.

The representative test for each group is defined as that with the N-th smallest p-value, as this is directly used as the combined p-value. The influential tests for each group are defined as those with p-values no greater than the representative test's p-value. This is based on the fact that increasing them (e.g., by setting them to unity) would result in a larger combined p-value.

Value

A list containing:

  • p.value, a named numeric vector of length equal to the number of unique levels in grouping. This contains the minimum Holm 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.

Author(s)

Aaron Lun

References

Holm S (1979). A simple sequentially rejective multiple test procedure. Scand. J. Stat. 6, 65-70.

See Also

parallelHolmMin, for a version that operates on parallel vectors of p-values.

groupedWilkinson, for a more relaxed version of this test when hypotheses are independent.

Examples

p1 <- rbeta(100, 0.8, 1)
g <- sample(10, length(p1), replace=TRUE)

# Standard application:
out <- groupedHolmMin(p1, g)
str(out)

# With weights:
out <- groupedHolmMin(p1, g, weights=rexp(length(p1)))
str(out)

# With log p-values. 
out <- groupedHolmMin(log(p1), g, log.p=TRUE)
str(out)


LTLA/metapod documentation built on Jan. 19, 2024, 11:49 p.m.