| Title: | Confidence Curves and P-Value Functions for Meta-Analysis |
|---|---|
| Description: | Provides tools for the combination of individual study results in meta-analyses using 'p-value' functions. Implements various combination methods including those by Fisher, Stouffer, Tippett, Edgington along with weighted generalizations. Contains functionality for the visualization and calculation of confidence curves and drapery plots to summarize evidence across studies. |
| Authors: | Saverio Fontana [aut, cre] (ORCID: <https://orcid.org/0009-0001-9116-7812>), Felix Hofmann [aut] (ORCID: <https://orcid.org/0000-0002-3891-6239>), Leonhard Held [aut] (ORCID: <https://orcid.org/0000-0002-8686-5325>), Samuel Pawel [aut] (ORCID: <https://orcid.org/0000-0003-2779-320X>) |
| Maintainer: | Saverio Fontana <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.1 |
| Built: | 2026-05-22 13:43:16 UTC |
| Source: | https://github.com/savefonta/confmeta |
confMeta objectsPlots one or more confMeta objects. This function can
create two types of plots: the p-value function plot (also known
as drapery plot) and the forest plot. This allows for direct visual
comparison of different p-value functions.
Optionally, a Bayesian meta-analysis object created with the
bayesmeta::bayesmeta() function can be supplied via the bayesmeta argument.
When provided, its posterior summary is displayed as an additional diamond
at the bottom of the forest plot for comparison with the frequentist methods
Important Note: If supplying a Bayesian meta-analysis object
via the bayesmeta argument, this function explicitly extracts the
95% credible intervals. If the Bayesian model was fit using a different
credible level, the function will crash.
## S3 method for class 'confMeta' autoplot( ..., type = c("p", "forest"), diamond_height = 0.5, v_space = 1.5, scale_diamonds = TRUE, show_studies = TRUE, drapery = TRUE, reference_methods_p = c("re"), reference_methods_forest = c("re", "hk", "hc"), ref_labels = NULL, xlim = NULL, xlim_p = NULL, xlim_forest = NULL, same_xlim = TRUE, xlab = NULL, n_breaks = 7, bayesmeta = NULL, n_points = 1000 )## S3 method for class 'confMeta' autoplot( ..., type = c("p", "forest"), diamond_height = 0.5, v_space = 1.5, scale_diamonds = TRUE, show_studies = TRUE, drapery = TRUE, reference_methods_p = c("re"), reference_methods_forest = c("re", "hk", "hc"), ref_labels = NULL, xlim = NULL, xlim_p = NULL, xlim_forest = NULL, same_xlim = TRUE, xlab = NULL, n_breaks = 7, bayesmeta = NULL, n_points = 1000 )
... |
One or more objects of class |
type |
A character vector of length 1 or 2. Indicates what type of
plot should be returned. Accepted values are |
diamond_height |
Numeric scalar. Indicates the maximal
possible height of the diamonds in the forest plot. Defaults to 0.5.
This argument is only relevant if |
v_space |
Numeric scalar. Indicates the vertical space
between two diamonds in the forest plot. Defaults to 1.5.
This argument is only relevant if |
scale_diamonds |
Logical. If |
show_studies |
Logical. If |
drapery |
Logical. If |
reference_methods_p |
Character vector controlling which reference
meta-analysis methods are shown as baseline curves in the
p-value function plot. Valid options are |
reference_methods_forest |
Character vector of length 1 to 4.
Specifies which reference meta-analysis methods should be shown as
diamonds in the forest plot. Valid options are any subset of
Defaults to |
ref_labels |
A named character vector to customize the labels of the reference
methods in the plot legends and axes (e.g., |
xlim |
Numeric vector of length 2. Global limits for the x-axis.
If |
xlim_p |
Numeric vector of length 2. Specific x-axis limits for the
p-value plot. Overrides |
xlim_forest |
Numeric vector of length 2. Specific x-axis limits for
the forest plot. Overrides |
same_xlim |
Logical. If |
xlab |
Character string. Label for the x-axis. Defaults to |
n_breaks |
Numeric. Approximate number of tick marks to display on the x-axis. Defaults to 7. |
bayesmeta |
An object of class |
n_points |
Numeric. Number of points used to create the p-value plot. Higher values (e.g., 10000) yield higher resolution but take longer to render. Defaults to 1000. |
An object of class ggplot containing the specified plot(s).
confMeta objectsFunction to create objects of class confMeta. This is the
main class within the package. For an overview of available methods
run methods(class = "confMeta").
confMeta( estimates, SEs, study_names = NULL, conf_level = 0.95, fun, fun_name = NULL, w = NULL, MH = FALSE, table_2x2 = NULL, measure = NULL, method.tau.re = "REML", method.tau.hk = "REML", method.tau.het = "REML", adhoc.hakn.ci = "IQWiG6", ... )confMeta( estimates, SEs, study_names = NULL, conf_level = 0.95, fun, fun_name = NULL, w = NULL, MH = FALSE, table_2x2 = NULL, measure = NULL, method.tau.re = "REML", method.tau.hk = "REML", method.tau.het = "REML", adhoc.hakn.ci = "IQWiG6", ... )
estimates |
A vector containing the individual effect estimates. These should be on
a scale where they are approximately normally distributed (e.g., log odds ratios, log risk
ratios, mean differences). Must be of the same length as |
SEs |
The standard errors of the individual effect estimates.
Must be of the same length as |
study_names |
Optional vector of study identifiers. If |
conf_level |
The confidence level (numeric scalar between 0 and 1). |
fun |
A function that combines estimates and SEs into a combined p-value.
The function must accept arguments |
fun_name |
A character vector of length 1. Label for |
w |
Numeric vector of weights for the studies. Must be of
the same length as |
MH |
Logical. If |
table_2x2 |
A data frame containing the 2x2 contingency table data for
Mantel-Haenszel pooling. Required if |
measure |
A character string indicating the effect measure to be used
for Mantel-Haenszel pooling (e.g., "OR", "RR", "RD"). Required if
|
method.tau.re |
Character string indicating which between-study variance
estimator to use for random-effects meta-analysis
(e.g., |
method.tau.hk |
Character string indicating which between-study variance
estimator to use for the Hartung-Knapp meta-analysis. Defaults to |
method.tau.het |
Character string indicating which between-study variance
estimator to use for calculating the general heterogeneity statistics in
|
adhoc.hakn.ci |
Character string indicating the variance correction
method for the Hartung-Knapp confidence intervals (e.g., |
... |
Additional arguments passed to |
An S3 object of class confMeta containing the following elements:
estimates, SEs, w, study_names, conf_level: Values
used to build the object.
individual_cis: Matrix of Wald-type confidence intervals for each study.
p_fun: The p-value function used for combined inference.
joint_cis: Combined confidence interval(s). Calculated
by finding the values where the p-value function is larger
than the significant level (1 - conf_level).
gamma: The local minima within the range of the individual effect
estimates. Column x refers to the mean and column y
contains the corresponding p-value.
p_max: The local maxima of the p-value function. Column x
refers to the mean and column y contains the corresponding
p-value.
p_0: The value of the p-value at .
comparison_cis: Combined confidence intervals calculated with other
methods. These can be used for comparison purposes. Currently, these
other methods are fixed effect (IV or Mantel-Haenszel), random effects (IV),
Hartung & Knapp, and Henmi & Copas.
comparison_p_0: The same as in element p_0 but for the comparison
methods (fixed effect, random effects, Hartung & Knapp, Henmi & Copas).
heterogeneity: A data frame with columns Q (Cochran's Q),
p_Q (p-value for Q), I2 (), Tau (),
I2_lower, and I2_upper, computed using the estimator defined
by method.tau.het.
table_2x2: The 2x2 table data frame (if provided), otherwise NULL.
Individual confidence intervals are calculated as:
where are the estimates, the SEs, and
.
Combined confidence intervals are found by inverting the p-value function,
identifying all where the p-value exceeds the significance level (1 - conf_level).
Also, the HK method uses adhoc.hakn.ci = "IQWiG6" by default, i.e., it uses variance correction if the HK confidence interval
is narrower than the CI from the classic random effects model with the DerSimonian-Laird estimator (IQWiG, 2022).
p_value_functions, autoplot.confMeta
# Simulate effect estimates and standard errors set.seed(42) n <- 5 estimates <- rnorm(n) SEs <- rgamma(n, 5, 5) conf_level <- 0.95 # Construct a simple confMeta object using p_edgington as # the p-value function cm <- confMeta( estimates = estimates, SEs = SEs, conf_level = conf_level, fun = p_edgington, fun_name = "Edgington", input_p = "greater" ) cm2 <- confMeta( estimates = estimates, SEs = SEs, conf_level = conf_level, fun = p_edgington_w, w = 1/SEs, fun_name = "Edgington (1/SE)", input_p = "greater" ) # print the objects cm cm2 # Plot the objects autoplot(cm, cm2, type = "p") # p-value function plot autoplot(cm, cm2, type = "forest") # forest plot autoplot(cm, cm2, type = c("p", "forest")) # both# Simulate effect estimates and standard errors set.seed(42) n <- 5 estimates <- rnorm(n) SEs <- rgamma(n, 5, 5) conf_level <- 0.95 # Construct a simple confMeta object using p_edgington as # the p-value function cm <- confMeta( estimates = estimates, SEs = SEs, conf_level = conf_level, fun = p_edgington, fun_name = "Edgington", input_p = "greater" ) cm2 <- confMeta( estimates = estimates, SEs = SEs, conf_level = conf_level, fun = p_edgington_w, w = 1/SEs, fun_name = "Edgington (1/SE)", input_p = "greater" ) # print the objects cm cm2 # Plot the objects autoplot(cm, cm2, type = "p") # p-value function plot autoplot(cm, cm2, type = "forest") # forest plot autoplot(cm, cm2, type = c("p", "forest")) # both
estimate_tau2 estimates the between-study heterogeneity
using an additive model. The resulting parameter
is estimated through a call to
meta::metagen with TE = estimates and
seTE = SEs. Other arguments to meta::metagen can be
passed via the ... argument. If no arguments are passed via
..., the following defaults are applied.
sm = "MD"
method.tau = "REML"
control = list(maxiter = 1e5, stepadj = 0.25)
However, each of these defaults can be overwritten via ....
estimate_phi estimates the between-study heterogeneity
using a multiplicative model. The function is a
modified version of Page 3 of:
Accounting for heterogeneity in meta-analysis using a
multiplicative model – an empirical study,
Mawdsley D. et al. 2016. doi:10.1002/jrsm.1216
estimate_tau2(estimates, SEs, ...) estimate_phi(estimates, SEs)estimate_tau2(estimates, SEs, ...) estimate_phi(estimates, SEs)
estimates |
Numeric vector of study-level effect estimates. |
SEs |
Numeric vector of corresponding standard errors. |
... |
Further arguments that are passed to |
For estimate_tau2: the estimated heterogeneity parameter
, a numeric vector of length 1.
For estimate_phi: the estimated heterogeneity parameter
, a numeric vector of length 1.
# Example estimates and std. errors estimates <- c(0.21, 0.53, 0.24, 0.32, 0.19) SEs <- c(0.19, 0.39, 0.7, 1, 0.97) # Estimating heterogeneity using the additive model estimate_tau2(estimates = estimates, SEs = SEs) # Example estimates and std. errors estimates <- c(0.21, 0.53, 0.24, 0.32, 0.19) SEs <- c(0.19, 0.39, 0.7, 1, 0.97) estimate_phi(estimates = estimates, SEs = SEs)# Example estimates and std. errors estimates <- c(0.21, 0.53, 0.24, 0.32, 0.19) SEs <- c(0.19, 0.39, 0.7, 1, 0.97) # Estimating heterogeneity using the additive model estimate_tau2(estimates = estimates, SEs = SEs) # Example estimates and std. errors estimates <- c(0.21, 0.53, 0.24, 0.32, 0.19) SEs <- c(0.19, 0.39, 0.7, 1, 0.97) estimate_phi(estimates = estimates, SEs = SEs)
Edgington’s method for combining p-values across studies. The method forms a sum of individual study p-values and evaluates it against the exact or approximate null distribution.
Under the global null hypothesis, the null distribution of the sum is given
by the Irwin–Hall distribution. For a weighted generalization of this
procedure, see p_edgington_w.
p_edgington( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided", approx = TRUE )p_edgington( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided", approx = TRUE )
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: |
approx |
Logical (default |
The classical Edgington statistic is defined for studies as
where are individual study p-values. Under the global null
hypothesis, each is assumed to be
uniformly distributed on .
Important note on orientation: Edgington's method is orientation-invariant.
The combined p-value is symmetric with respect to the direction of the
one-sided p-values (controlled by the input_p argument).
Specifically, computing the Edgington combined p-value for the "greater" alternative results in 1 minus the Edgington combined p-value for the "less" alternative.
A numeric vector of combined p-values corresponding
to each value of mu.
The combined p-value, , is the probability of observing a sum
less than or equal to under the null hypothesis. This is computed in
one of two ways:
Exact Method: The function uses the exact Irwin-Hall distribution to compute the combined p-value:
Normal Approximation: For a large number of studies (),
the distribution of the sum is approximated by a Normal distribution with:
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 , and returns a symmetrized, two-sided p-value:
.
If output_p = "one.sided", the function
returns the inherently one-sided combined p-value
directly, without symmetrization.
If input_p is "two.sided", the input
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. 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. doi:10.1017/rsm.2025.26
Other p-value combination functions:
p_edgington_w(),
p_fisher(),
p_hmean(),
p_pearson(),
p_stouffer(),
p_tippett(),
p_wilkinson()
# 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 Edgington's method to calculate the combined p-value p_edgington( estimates = estimates, SEs = SEs, mu = mu, heterogeneity = "none", output_p = "two.sided", input_p = "greater", approx = TRUE )# 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 Edgington's method to calculate the combined p-value p_edgington( estimates = estimates, SEs = SEs, mu = mu, heterogeneity = "none", output_p = "two.sided", input_p = "greater", approx = TRUE )
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 )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 studies as
where are positive study weights and are individual
study p-values. Under the global null hypothesis, each is assumed to be
uniformly distributed on .
A numeric vector of combined p-values corresponding
to each value of mu.
The CDF of the test statistic under the null, ,
is computed in one of two ways:
Exact Method: The function uses the exact Barrow-Smith inclusion-exclusion formula to compute the CDF.
This method is computationally intensive and is infeasible for
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, is approximated by a Normal
distribution with:
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:
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
criterion used in this function:
The default neff_cut = 12 is chosen based on this, as it
corresponds to an approximate maximum error of
.
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 , and returns a symmetrized, two-sided p-value:
.
If output_p = "one.sided", the function
returns the inherently one-sided combined p-value
directly, without symmetrization.
If input_p is "two.sided", the input
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. 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. 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. 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" )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" )
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.
p_fisher( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided" )p_fisher( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided" )
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: |
The Fisher test statistic for studies is defined as:
Under the global null hypothesis, each is assumed to be
uniformly distributed on . The test statistic therefore follows a
chi-squared distribution with degrees of freedom: .
The combined p-value, , is calculated as the probability of observing a
value strictly greater than from this distribution:
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.
A numeric vector of combined p-values corresponding
to each value of mu.
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 , and returns a symmetrized, two-sided p-value:
.
If output_p = "one.sided", the function
returns the inherently one-sided combined p-value
directly, without symmetrization.
If input_p is "two.sided", the input
are already two-sided, and no further symmetrization is applied.
Fisher R.A. Statistical Methods for Research Workers. 4th ed. Oliver & Boyd; 1932. 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. doi:10.1017/rsm.2025.26
Other p-value combination functions:
p_edgington(),
p_edgington_w(),
p_hmean(),
p_pearson(),
p_stouffer(),
p_tippett(),
p_wilkinson()
# 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" )# 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" )
Combines study-level results using the harmonic mean combination method
p_hmean( estimates, SEs, mu = 0, phi = NULL, tau2 = NULL, heterogeneity = "none", check_inputs = TRUE, w = rep(1, length(estimates)), distr = "chisq" )p_hmean( estimates, SEs, mu = 0, phi = NULL, tau2 = NULL, heterogeneity = "none", check_inputs = TRUE, w = rep(1, length(estimates)), distr = "chisq" )
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 |
check_inputs |
Either |
w |
Numeric vector of nonnegative weights, same length as |
distr |
The distribution to use for the calculation of the p-value. Currently, the options are
|
The harmonic mean statistic for studies is defined as
where and are individual study z-values and weights,
respectively. Under the global null hypothesis, each 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 from this distribution:
A numeric vector of combined p-values corresponding
to each value of mu.
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. 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. doi:10.1017/rsm.2025.26
Other p-value combination functions:
p_edgington(),
p_edgington_w(),
p_fisher(),
p_pearson(),
p_stouffer(),
p_tippett(),
p_wilkinson()
estimates <- c(0.5, 0.8, 0.3) SEs <- c(0.1, 0.2, 0.1) p_hmean(estimates, SEs, mu = 0, distr = "f")estimates <- c(0.5, 0.8, 0.3) SEs <- c(0.1, 0.2, 0.1) p_hmean(estimates, SEs, mu = 0, distr = "f")
Pearson's method for combining p-values across studies. The method transforms the complement of the individual study p-values using the natural logarithm and evaluates the sum against a chi-squared distribution.
p_pearson( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided" )p_pearson( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided" )
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: |
The Pearson test statistic for studies is defined as:
Under the global null hypothesis, each is assumed to be
uniformly distributed on . The test statistic therefore follows a
chi-squared distribution with degrees of freedom: .
The combined p-value, , is calculated as the probability of observing a
value less than or equal to from this distribution:
Important note on orientation: Unlike Edgington's method, Pearson'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, Pearson's and Fisher's methods are mirrored. Computing the Pearson combined p-value for the "greater" alternative is equal to 1 minus the Fisher combined p-value for the "less" alternative.
A numeric vector of combined p-values corresponding
to each value of mu.
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 , and returns a symmetrized, two-sided p-value:
.
If output_p = "one.sided", the function
returns the inherently one-sided combined p-value
directly, without symmetrization.
If input_p is "two.sided", the input
are already two-sided, and no further symmetrization is applied.
Pearson K. On a method of determining whether a sample of size n supposed to have been drawn from a parent population having a known probability integral has probably been drawn at random. Biometrika, 25:379-410, 1933. doi:10.2307/2332290
Held, L, Hofmann, F, Pawel, S. (2025). A comparison of combined p-value functions for meta-analysis. Research Synthesis Methods, 16:758-785. doi:10.1017/rsm.2025.26
Other p-value combination functions:
p_edgington(),
p_edgington_w(),
p_fisher(),
p_hmean(),
p_stouffer(),
p_tippett(),
p_wilkinson()
# 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 Pearson's method to calculate the combined p-value p_pearson( estimates = estimates, SEs = SEs, mu = mu, heterogeneity = "none", output_p = "two.sided", input_p = "greater" )# 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 Pearson's method to calculate the combined p-value p_pearson( estimates = estimates, SEs = SEs, mu = mu, heterogeneity = "none", output_p = "two.sided", input_p = "greater" )
Stouffer's method for combining p-values across studies
p_stouffer( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, w = 1/SEs, output_p = "two.sided" )p_stouffer( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, w = 1/SEs, output_p = "two.sided" )
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 |
w |
Numeric vector of study weights. Defaults to |
output_p |
Character string specifying the combined
p-value type: |
Stouffer's z-statistic for studies is defined as
where and are individual study z-values and
weights, respectively. Under the global null hypothesis, each is
assumed to follow a standard normal distribution. Stouffer's z-statistic
then also follows a standard normal distribution. The combined p-value
is calculated as the probability of observing a value equal or greater than
from this distribution:
A numeric vector of combined p-values corresponding
to each value of mu.
Stouffer SA, et al. The American Soldier. Princeton University Press, 1949. doi:10.2307/2572105
Held, L, Hofmann, F, Pawel, S. (2025). A comparison of combined p-value functions for meta-analysis. Research Synthesis Methods, 16:758-785. doi:10.1017/rsm.2025.26
Other p-value combination functions:
p_edgington(),
p_edgington_w(),
p_fisher(),
p_hmean(),
p_pearson(),
p_tippett(),
p_wilkinson()
estimates <- c(0.1, 0.2, 0.3) SEs <- c(0.05, 0.05, 0.1) p_stouffer(estimates, SEs, mu = 0, heterogeneity = "none")estimates <- c(0.1, 0.2, 0.3) SEs <- c(0.05, 0.05, 0.1) p_stouffer(estimates, SEs, mu = 0, heterogeneity = "none")
Tippett's method for combining p-values across studies. This method evaluates the minimum individual study p-value.
p_tippett( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided" )p_tippett( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided" )
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: |
The Tippett combined p-value, , for studies is
defined directly as:
Under the global null hypothesis, each is assumed to be
uniformly distributed on .
Important note on orientation: Unlike Edgington's method, Tippett'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, Tippett's and Wilkinson's methods are mirrored. Computing the Tippett combined p-value for the "greater" alternative is equal to 1 minus the Wilkinson combined p-value for the "less" alternative.
A numeric vector of combined p-values corresponding
to each value of mu.
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 , and returns a symmetrized, two-sided p-value:
.
If output_p = "one.sided", the function
returns the inherently one-sided combined p-value
directly, without symmetrization.
If input_p is "two.sided", the input
are already two-sided, and no further symmetrization is applied.
Tippett LHC. Methods of Statistics. Williams Norgate; 1931. doi:10.2307/3606890
Held, L, Hofmann, F, Pawel, S. (2025). A comparison of combined p-value functions for meta-analysis. Research Synthesis Methods, 16:758-785. doi:10.1017/rsm.2025.26
Other p-value combination functions:
p_edgington(),
p_edgington_w(),
p_fisher(),
p_hmean(),
p_pearson(),
p_stouffer(),
p_wilkinson()
# 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 Tippett's method to calculate the combined p-value p_tippett( estimates = estimates, SEs = SEs, mu = mu, heterogeneity = "none", output_p = "two.sided", input_p = "greater" )# 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 Tippett's method to calculate the combined p-value p_tippett( estimates = estimates, SEs = SEs, mu = mu, heterogeneity = "none", output_p = "two.sided", input_p = "greater" )
The p_value_functions family is useful to combine
individual study effect estimates and standard errors into a single
meta-analytical p-value function. These functions are the
building blocks for the confMeta function.
Vectorization over mu:
All of the p-value functions in this package are vectorized over the
mu argument. This means that you can pass a sequence of null values
(e.g., seq(-2, 2, length.out = 1000)) and the function will
evaluate the combined p-value for every point. This is specifically
designed to construct p-value functions
and invert the tests to find confidence intervals at any desired level.
Available Methods:
p_edgington: Classical Edgington method (Sum of p-values).
p_edgington_w: Weighted Edgington method.
p_fisher: Fisher's method (Log-product of p-values).
p_pearson: Pearson's method (Log-product of complements).
p_tippett: Tippett's method (Minimum p-value).
p_wilkinson: Wilkinson's method (Maximum p-value).
p_stouffer: Stouffer's method.
p_hmean: Harmonic mean method.
Held, L, Hofmann, F, Pawel, S. (2025). A comparison of combined p-value functions for meta-analysis. Research Synthesis Methods, 16:758-785. doi:10.1017/rsm.2025.26
Wilkinson's method for combining p-values across studies. This method evaluates the maximum individual study p-value.
p_wilkinson( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided" )p_wilkinson( estimates, SEs, mu = 0, heterogeneity = "none", phi = NULL, tau2 = NULL, check_inputs = TRUE, input_p = "greater", output_p = "two.sided" )
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: |
The Wilkinson combined p-value for studies is defined as:
Under the global null hypothesis, each is assumed to be
uniformly distributed on .
Important note on orientation: Unlike Edgington's method, Wilkinson'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, Wilkinson's and Tippett's methods are mirrored. Computing the Wilkinson combined p-value for the "greater" alternative is equal to 1 minus the Tippett combined p-value for the "less" alternative.
A numeric vector of combined p-values corresponding
to each value of mu.
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 , and returns a symmetrized, two-sided p-value:
.
If output_p = "one.sided", the function
returns the inherently one-sided combined p-value
directly, without symmetrization.
If input_p is "two.sided", the input
are already two-sided, and no further symmetrization is applied.
Wilkinson B. A statistical consideration in psychological research. Psychological Bulletin, 48(2):156-158, 1951. doi:10.1037/h0059111
Held, L, Hofmann, F, Pawel, S. (2025). A comparison of combined p-value functions for meta-analysis. Research Synthesis Methods, 16:758-785. doi:10.1017/rsm.2025.26
Other p-value combination functions:
p_edgington(),
p_edgington_w(),
p_fisher(),
p_hmean(),
p_pearson(),
p_stouffer(),
p_tippett()
# 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 Wilkinson's method to calculate the combined p-value p_wilkinson( estimates = estimates, SEs = SEs, mu = mu, heterogeneity = "none", output_p = "two.sided", input_p = "greater" )# 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 Wilkinson's method to calculate the combined p-value p_wilkinson( estimates = estimates, SEs = SEs, mu = mu, heterogeneity = "none", output_p = "two.sided", input_p = "greater" )