View source: R/pfun_edgington_w.R
| p_edgington_w | R Documentation |
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.
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
)
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 |
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 |
input_p |
Type of study-level p-values used in the combination:
|
output_p |
Character string specifying the combined
p-value type: |
w |
Numeric vector of nonnegative weights, same length as |
approx |
Logical (default |
approx_rule |
Rule for normal approximation: |
neff_cut |
Numeric threshold (default 12). If |
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].
A numeric vector of combined p-values corresponding
to each value of mu.
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
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.
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.
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.
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")}
Other p-value combination functions:
p_edgington(),
p_fisher(),
p_hmean(),
p_pearson(),
p_stouffer(),
p_tippett(),
p_wilkinson()
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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.