p_hmean: Harmonic mean method

View source: R/pfun_hmean.R

p_hmeanR Documentation

Harmonic mean method

Description

Combines study-level results using the harmonic mean combination method

Usage

p_hmean(
  estimates,
  SEs,
  mu = 0,
  phi = NULL,
  tau2 = NULL,
  heterogeneity = "none",
  check_inputs = TRUE,
  w = rep(1, length(estimates)),
  distr = "chisq"
)

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).

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.

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".

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.

w

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

distr

The distribution to use for the calculation of the p-value. Currently, the options are "f" (F-distribution) and "chisq" (Chi-squared distribution). Defaults to "chisq".

Details

The harmonic mean statistic for k studies is defined as

x^2 = \frac{\sum_{i=1}^k \sqrt{w_i}}{\sum_{i=1}^k w_i/z_i^2},

where z_i and {w_i} are individual study z-values and weights, respectively. Under the global null hypothesis, each z_i is assumed to follow a standard normal distribution. The harmonic mean statistic then follows a chi-squared distribution with one degree of freedom. The combined p-value is calculated as the probability of observing a value equal or greater than x^2 from this distribution:

p_H = \Pr(\chi^2_{1} > x^2)

Value

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

References

Held, L. (2020). The harmonic mean chi-squared test to substantiate scientific findings. Journal of the Royal Statistical Society: Series C (Applied Statistics), 69:697-708. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/rssc.12410")}

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")}

See Also

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

Examples

estimates <- c(0.5, 0.8, 0.3)
SEs <- c(0.1, 0.2, 0.1)
p_hmean(estimates, SEs, mu = 0, distr = "f")


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