hMeanChiSq: Computes the p-value from the harmonic mean chi-squared test

Description Usage Arguments Value Author(s) References Examples

View source: R/hMeanChiSq.R

Description

The p-value from the harmonic mean chi-squared test is computed based on study-specific z-values.

Usage

1
hMeanChiSq(z, w=rep(1, length(z)), alternative="greater", bound=TRUE)

Arguments

z

A vector of z-values.

w

A vector of weights.

alternative

Either "greater", "less", "two.sided" or "none". Defaults to "greater". Specifies the alternative to be considered in the computation of the p-value.

bound

Determines whether p-value that cannot be computed are reported as "> bound" ("bound=TRUE") or as NA ("bound=FALSE")

Value

The p-value from the harmonic mean chi-squared test

Author(s)

Leonhard Held

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. https://doi.org/10.1111/rssc.12410

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
    
## Example from Fisher (1999) as discussed in Held (2020)
library(ReplicationSuccess)
pvalues <- c(0.0245, 0.1305, 0.00025, 0.2575, 0.128)
lower <- c(0.04, 0.21, 0.12, 0.07, 0.41)
upper <- c(1.14, 1.54, 0.60, 3.75, 1.27)
se <- ci2se(lower, upper, ratio=TRUE)
estimate <- ci2estimate(lower, upper, ratio=TRUE)

hMeanChiSq(p2z(pvalues, alternative="less"), alternative="less")
hMeanChiSq(p2z(pvalues, alternative="less"), alternative="two.sided")
hMeanChiSq(p2z(pvalues, alternative="less"), alternative="none")

hMeanChiSq(p2z(pvalues, alternative="less"),  w=1/se^2, alternative="less")
hMeanChiSq(p2z(pvalues, alternative="less"),  w=1/se^2, alternative="two.sided")
hMeanChiSq(p2z(pvalues, alternative="less"),  w=1/se^2, alternative="none")

ReplicationSuccess documentation built on Dec. 2, 2020, 3 p.m.