groupedPearson: Combine grouped p-values with Pearson's method

View source: R/groupedPearson.R

groupedPearsonR Documentation

Combine grouped p-values with Pearson's method

Description

Combine p-values from grouped tests with Pearson's method. Groups are defined according to unique levels of a grouping factor.

Usage

groupedPearson(p.values, grouping, log.p = FALSE)

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.

log.p

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

Details

Here, the joint null hypothesis for each group is that all of the individual null hypotheses are true. Pearson's method combines information from all individual nulls to determine if the joint null should be rejected. Compared to Stouffer's and Pearson's methods, Pearson's method is more sensitive to the largest individual p-value. This method is only applicable to independent tests and no weights are considered.

The representative test for each group is defined as the test with the largest p-value, as this has the greatest effect on the combined 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.

Value

A list containing:

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

Pearson K (1934). On a new method of deternining “goodness of fit.” Biometrika 26, 425-442.

See Also

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

groupedFisher and groupedStouffer, for different approaches to testing a joint null of independent hypotheses.

Examples

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

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

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


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