DPComb_tests: Discrete P-value Combination Tests

View source: R/DPComb_Functions.R

DPComb_testsR Documentation

Discrete P-value Combination Tests

Description

This function combines evidence of significance to test a global null hypothesis that the given discrete null distributions are true. The tests can be based on discrete p-values or the corresponding discrete X statistics, and their null distributions.

Usage

DPComb_tests(
  ps = NULL,
  p_supports = NULL,
  xs = NULL,
  side = "two",
  x_support_probs = NULL,
  x_distn_params = NULL,
  method = "fisher_mean"
)

Arguments

ps

Optional. A vector of observed discrete p-values to be combined.

p_supports

Optional. A vector or list of p-value supports, characterizing the null distribution of discrete p-values. A vector can be used when all p-values are from the same distribution under the null, i.e., the i.i.d. case. A list allows for non-identical distributions, containing p-value support vectors matching the distributions of the elements in ps.

xs

Optional. A vector of observed discrete X statistics, from which the p-values in ps are obtained. It is not used if ps is given, but required if ps is NULL.

side

sidedness of p-values to be combined. One of "two" (default), "right" or "left".

x_support_probs

Optional. A list containing x_support and x_prob vectors to characterize the null distributions of X statistics under the null distribution. For the i.i.d. case, where each element in xs follows the same distribution, it is a list of two vectors x_support and x_prob. For non-identical distributions, x_support_probs is required to be a list of lists, each sublist containing the x_support and x_prob vectors to define the null distributions of X, corresponding to the elements of xs. The number of sublists should equal the length of xs or ps.

x_distn_params

Optional. A list containing the description of null distributions for the discrete X statistics. See the details. For the i.i.d. case, it is a simple list. For non-identical distributions, x_distn_params is required to be a list of lists, each sublist defining the null distributions of one X statistic, consistent with xs or ps. The number of sublists should equal the length of xs.

method

The combination testing method. One of "fisher_mean" (default), "fisher_median", "pearson", "edgington", "stouffer", or "george". See the details.

Details

This function calculates the following types of p-value combination statistics Sn and their testing p-values pval.

Method Statistic
Fisher T_F = -2\sum_{j=1}^n \log P_j
Pearson T_P = -2\sum_{j=1}^n \log (1 - P_j)
George T_G = \frac{T_P - T_F}{2} = \sum_{j=1}^n \log \frac{P_j}{1 - P_j}
Stouffer T_S = \sum_{j=1}^n \Phi^{-1}(P_j)
Edgington T_E = \sum_{j=1}^n P_j

Smaller p-values represent higher significance against the null hypothesis. By its formula, a larger Sn in Fisher's combination method, or a smaller Sn in other combination methods, indicates a higher significance level against the null hypothesis. These statistics are adjusted by an "adjusted Z statistic" obtained by a Wasserstein distance optimization process. For Fisher's combination, the two methods "fisher_mean" and "fisher_median" correspond to Lancaster's mean-value chi-squared method and median-value chi-squared method, respectively.

The supported distribution descriptions and parameters:

  • Binomial: list(distn = "binom", size = , prob = ).

  • Poisson: list(distn = "pois", lambda = ).

  • Hypergeometric: list(distn = "hyper", m = , n = , k = ).

  • Noncentral Hypergeometric: list(distn = "noncenhypergeom", n1 = , n2 = , m1 = , psi = ). Requires the MCMCpack package.

  • Negative Binomial: list(distn = "nbinom", size = , prob = ).

  • Geometric: list(distn = "geom", prob = ).

Value

A list with elements:

Sn

The combination statistic

pval

The p-value of the combination statistic

References

Lancaster, HO (1949). The combination of probabilities arising from data in discrete distributions. Biometrika, 36(3/4), 370-382.

Contador, Gonzalo and Wu, Zheyang (2025). A minimum Wasserstein distance approach to Fisher's combination of independent, discrete p-values. Scandinavian Journal of Statistics, 52(3), 1281-1300.

Contador, Gonzalo and Wu, Zheyang (2026). Optimal Adjustment and Combination of Independent Discrete p-Values. Under revision at the Journal of Computational and Graphical Statistics.

Examples

# Example 1: p-values from the same distribution
p_supports <- seq(0.01, 1, length.out = 100)
methods <- c("fisher_mean", "fisher_median", "pearson", "george", "stouffer", "edgington")

ps <- c(0.1, 0.2, 0.21, 0.35)
sapply(methods, function(m) DPComb_tests(ps=ps, p_supports=p_supports, method=m))

# Example 2: p-values from different distributions
p_supports1 <- seq(0.01, 1, length.out = 10)
p_supports2 <- seq(0.3, 1, length.out = 5)
p_supports3 <- seq(0.01, 1, length.out = 100)
p_supports <- list(p_supports1, p_supports2, p_supports3)
ps <- c(0.12, 0.475, 0.21)
sapply(methods, function(m) DPComb_tests(ps=ps, p_supports=p_supports, method=m))

# Example 3: input xs and x_support_probs from the same distribution
xs <- c(0, 1, 2)
x_support_probs <- list(x_support = 0:5, x_prob = dbinom(0:5, size = 5, prob = 0.1))
sapply(methods, function(m) DPComb_tests(xs=xs, x_support_probs=x_support_probs, 
                                         side="two", method=m))

# Example 4: input xs and x_support_probs from different distributions
xs <- c(0, 1, 2)
x_supports <- list(0:5, 0:5, 0:5)
x_probs <- list(dbinom(0:5, size = 5, prob = 0.1), dbinom(0:5, size = 5, prob = 0.2), 
                dbinom(0:5, size = 5, prob = 0.3))
x_support_probs <- lapply(1:length(x_supports), 
                         function(i) list(x_support = x_supports[[i]], 
                                          x_prob = x_probs[[i]]))
sapply(methods, function(m) DPComb_tests(xs=xs, x_support_probs=x_support_probs, 
                                         side="two", method=m))
sapply(methods, function(m) DPComb_tests(xs=xs, x_support_probs=x_support_probs, 
                                         side="right", method=m))

# Example 5: input xs and x_distn_params from the same distribution
xs <- c(0, 1, 2)
x_distn_params <- list(distn = "binom", size = 5, prob = 0.1)
sapply(methods, function(m) DPComb_tests(xs=xs, x_distn_params=x_distn_params, 
                                         side="two", method=m))

# Example 6: input xs and x_distn_params from different distributions
xs <- c(0, 1, 2)
x_distn_params <- list(list(distn = "binom", size = 5, prob = 0.1), 
                            list(distn = "binom", size = 5, prob = 0.2), 
                            list(distn = "binom", size = 5, prob = 0.3))
sapply(methods, function(m) DPComb_tests(xs=xs, x_distn_params=x_distn_params, 
                                         side="two", method=m))
sapply(methods, function(m) DPComb_tests(xs=xs, x_distn_params=x_distn_params, 
                                         side="right", method=m))

# Example 7: input xs and x_distn_params from different types of distributions: 
# binomial, poisson, and hypergeometric
xs <- c(0, 1, 2)
x_distn_params <- list(list(distn = "binom", size = 5, prob = 0.1), 
                       list(distn = "pois", lambda = 5), 
                       list(distn = "hyper", m = 10, n = 5, k = 3))
sapply(methods, function(m) DPComb_tests(xs=xs, x_distn_params=x_distn_params, 
                                         side="two", method=m))
# Example 8: input ps and x_support_probs. 
# Require ps and x_support_probs are consistent, i.e., ps are in the the p_supports 
# generated from x_support_probs. Avoid using this if unsure. 
ps <- c(0.00001, 0.00032, 0.00243)
x_support_probs <- list(list(x_support = 0:5, x_prob = dbinom(0:5, size = 5, prob = 0.1)),
            list(x_support = 0:5, x_prob = dbinom(0:5, size = 5, prob = 0.2)),
            list(x_support = 0:5, x_prob = dbinom(0:5, size = 5, prob = 0.3)))
sapply(methods, function(m) DPComb_tests(ps=ps, x_support_probs=x_support_probs, method=m))
sapply(methods, function(m) DPComb_tests(ps=ps, x_support_probs=x_support_probs, 
                                         side="right", method=m))
# Example 9: input ps and x_distn_params
# Require ps and x_distn_params are consistent, i.e., ps are in the the p_supports 
# generated from x_distn_params. Avoid using this if unsure. 
ps <- c(0.00001, 0.00032, 0.00243)
x_distn_params <- list(list(distn = "binom", size = 5, prob = 0.1), 
                       list(distn = "binom", size = 5, prob = 0.2), 
                       list(distn = "binom", size = 5, prob = 0.3))
sapply(methods, function(m) DPComb_tests(ps=ps, x_distn_params=x_distn_params, method=m))


DPComb documentation built on Aug. 22, 2026, 5:08 p.m.

Related to DPComb_tests in DPComb...