p_fisher: Fisher's method

View source: R/pfun_fisher.R

p_fisherR Documentation

Fisher's method

Description

Fisher's method for combining p-values across studies. The method transforms the individual study p-values using the natural logarithm and evaluates the sum against a chi-squared distribution.

Usage

p_fisher(
  estimates,
  SEs,
  mu = 0,
  heterogeneity = "none",
  phi = NULL,
  tau2 = NULL,
  check_inputs = TRUE,
  input_p = "greater",
  output_p = "two.sided"
)

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

Details

The Fisher test statistic for k studies is defined as:

f = -2 \sum_{i=1}^k \log(p_i)

Under the global null hypothesis, each p_i is assumed to be uniformly distributed on [0, 1]. The test statistic f therefore follows a chi-squared distribution with 2k degrees of freedom: \chi^2_{2k}. The combined p-value, p_F, is calculated as the probability of observing a value strictly greater than f from this distribution:

p_F = \Pr(\chi^2_{2k} > f)

Important note on orientation: Unlike Edgington's method, Fisher's method is not orientation-invariant. The combined p-value depends on the direction of the one-sided p-values (controlled by the input_p argument).

Specifically, Fisher's and Pearson's methods are mirrored. Computing the Fisher combined p-value for the "greater" alternative is equal to 1 minus the Pearson combined p-value for the "less" alternative.

Value

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

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

Fisher R.A. Statistical Methods for Research Workers. 4th ed. Oliver & Boyd; 1932. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/oso/9780198522294.002.0003")}

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_hmean(), p_pearson(), p_stouffer(), p_tippett(), p_wilkinson()

Examples

# Simulating estimates and standard errors
n <- 15
estimates <- rnorm(n)
SEs <- rgamma(n, 5, 5)

# Set up a vector of means under the null hypothesis
mu <- seq(
   min(estimates) - 0.5 * max(SEs),
   max(estimates) + 0.5 * max(SEs),
   length.out = 100
)

# Using Fisher's method to calculate the combined p-value
p_fisher(
     estimates = estimates,
     SEs = SEs,
     mu = mu,
     heterogeneity = "none",
     output_p = "two.sided",
     input_p = "greater"
)


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