p_edgington_w: Weighted Edgington’s method

View source: R/pfun_edgington_w.R

p_edgington_wR Documentation

Weighted Edgington’s method

Description

Weighted generalization of Edgington’s method for combining p-values across studies. The method forms a weighted sum of individual study p-values and evaluates it against the exact or approximate null distribution.

If all weights are equal, this reduces to the classical Edgington procedure, where the null distribution is given by the Irwin–Hall distribution.

Usage

p_edgington_w(
  estimates,
  SEs,
  mu = 0,
  heterogeneity = "none",
  phi = NULL,
  tau2 = NULL,
  check_inputs = TRUE,
  input_p = "greater",
  output_p = "two.sided",
  w = rep(1, length(estimates)),
  approx = TRUE,
  approx_rule = "neff",
  neff_cut = 12
)

Arguments

estimates

Numeric vector of study-level effect estimates.

SEs

Numeric vector of corresponding standard errors.

mu

Numeric scalar or vector of null values for the overall effect (default: 0).

heterogeneity

One of c("none", "additive", "multiplicative"). If heterogeneity = "none", p-values are returned for the passed SEs without any adaptation. If heterogeneity = "additive", the standard errors are reassigned the value \sqrt{SEs^2 + \text{tau2}} before computation of the p-values. If heterogeneity = "multiplicative", the standard errors SEs are multiplied by \sqrt{\text{phi}} before computation of the p-values. Defaults to "none".

phi

A numeric vector of length 1. Must be finite and larger than 0. The square root of the argument is used to scale the standard errors.

tau2

A numeric vector of length 1. Additive heterogeneity parameter.

check_inputs

Either TRUE (default) or FALSE. Indicates whether or not to check the input arguments. The idea of this argument is that if the function is called a large amount of times in an automated manner as for example in simulations, performance might be increased by not checking inputs in every single iteration. However, setting the argument to FALSE might be dangerous.

input_p

Type of study-level p-values used in the combination: "greater" (default), "less", or "two.sided". If "greater" or "less", one-sided p-values are combined.

output_p

Character string specifying the combined p-value type: "two.sided" (default) or "one.sided". This controls whether the final combined p-value is symmetrized. Note: To construct valid p-value functions, the confMeta

w

Numeric vector of nonnegative weights, same length as estimates. Defaults to equal weights.

approx

Logical (default TRUE). If TRUE, use a normal approximation for the weighted sum when the condition defined by approx_rule is met.

approx_rule

Rule for normal approximation: "n" uses the number of studies; "neff" (default) uses the effective sample size criterion (see Details).

neff_cut

Numeric threshold (default 12). If approx_rule="n", normal approximation is used when n \geq 12. If approx_rule="neff", normal approximation is used when \|w\|_2^4 / \|w\|_4^4 \geq 12.

Details

The weighted Edgington statistic is defined for k studies as

S = \sum_{i=1}^k w_i p_i,

where w_i are positive study weights and p_i are individual study p-values. Under the global null hypothesis, each p_i is assumed to be uniformly distributed on [0, 1].

Value

A numeric vector of combined p-values corresponding to each value of mu.

Null Distribution and Approximation

The CDF of the test statistic S under the null, F(t) = \Pr(S \leq t), is computed in one of two ways:

  • Exact Method: The function uses the exact Barrow-Smith inclusion-exclusion formula to compute the CDF.

    F(t) = \frac{1}{k! \prod_{i=1}^k w_i} \sum_{v \in \{0,1\}^k} (-1)^{\sum v_j} (t - w^T v)^k \mathbf{I}_{\{t - w^T v \ge 0\}}

    This method is computationally intensive and is infeasible for k > 18 studies, at which point the function will stop with an error if approx = FALSE is used.

  • Normal Approximation: For a large number of studies or sufficiently balanced weights, S is approximated by a Normal distribution with:

    \mathrm{E}[S] = \frac{1}{2}\sum_{i=1}^k w_i

    \mathrm{Var}(S) = \frac{1}{12}\sum_{i=1}^k w_i^2

Approximation Rule

The approx = TRUE argument enables the normal approximation, but it is only used if a condition (controlled by approx_rule) is met.

  • approx_rule = "n": Uses the approximation if the number of studies n > neff_cut.

  • approx_rule = "neff" (default): Uses the approximation if the effective sample size n_eff > neff_cut.

The effective sample size is defined as:

n_{\mathrm{eff}} = \frac{(\sum w_i^2)^2}{\sum w_i^4} = \frac{\|w\|_2^4}{\|w\|_4^4}

The default threshold neff_cut = 12 is based on error bounds, which indicate the approximation is sufficiently accurate when this condition is met. This rule is more robust than approx_rule = "n" when weights are unbalanced.

Approximation Error

The neff_cut parameter directly controls the tolerance for the approximation error. Edgeworth Approximation: This provides an approximation of the error, which directly relates to the n_{\mathrm{eff}} criterion used in this function:

\sup_{t \in \mathbb{R}} |F_n^w(t) - \Phi(t)| \approx \frac{\|\phi^{(3)}\|_{\infty}}{20}\frac{\|w\|_{4}^{4}}{\|w\|_{2}^{4}} \approx \frac{0.028}{n_{\mathrm{eff}}}

The default neff_cut = 12 is chosen based on this, as it corresponds to an approximate maximum error of 0.028 / 12 \approx 0.0023. If you change neff_cut, you are changing this error tolerance.

Output p-value

The final output depends on the output_p and input_p arguments:

  • If output_p = "two.sided" (the default) and the inputs are one-sided (input_p is "greater" or "less"), the function combines the one-sided p-values to obtain the intermediate combined p-value p_c, and returns a symmetrized, two-sided p-value: p_{2s} = 2 \min(p_c, 1 - p_c).

  • If output_p = "one.sided", the function returns the inherently one-sided combined p-value p_c directly, without symmetrization.

  • If input_p is "two.sided", the input p_i are already two-sided, and no further symmetrization is applied.

References

Edgington, E. S. (1972). An additive method for combining probability values from independent experiments. The Journal of Psychology, 80(2): 351-363. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00223980.1972.9924813")}

Held, L, Hofmann, F, Pawel, S. (2025). A comparison of combined p-value functions for meta-analysis. Research Synthesis Methods, 16:758-785. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/rsm.2025.26")}

Barrow, D. L., & Smith, P. W. (1979). Spline notation applied to a volume problem. The American Mathematical Monthly, 86(1): 50-51. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00029890.1979.11994730")}

See Also

Other p-value combination functions: p_edgington(), p_fisher(), p_hmean(), p_pearson(), p_stouffer(), p_tippett(), p_wilkinson()

Examples

n <- 10
estimates <- rnorm(n)
SEs <- rgamma(n, 5, 5)
weights <- 1/SEs

p_edgington_w(
    estimates = estimates,
    SEs = SEs,
    mu = 0,
    output_p = "two.sided",
    input_p = "greater",
    w = weights,
    approx = TRUE,
    approx_rule = "neff"
)

confMeta documentation built on June 10, 2026, 1:06 a.m.