p_edgington | R Documentation |
These functions combine individual effect estimates and the corresponding standard errors into a single \emph{p}-value. Under the hood, all of the functions transform the estimates and standard errors into \emph{z}, and subsequently into \emph{p}-values. The resulting \emph{p}-values are combined into the chosen statistic and an appropriate distribution is used to derive the combined \emph{p}-value. All of the \emph{p}-value functions are vectorized over the \code{mu} argument.
p_edgington(
estimates,
SEs,
mu = 0,
heterogeneity = "none",
phi = NULL,
tau2 = NULL,
alternative = "two.sided",
check_inputs = TRUE,
approx = TRUE,
input_p = "greater"
)
p_fisher(
estimates,
SEs,
mu = 0,
phi = NULL,
tau2 = NULL,
heterogeneity = "none",
check_inputs = TRUE,
input_p = "greater"
)
p_hmean(
estimates,
SEs,
mu = 0,
phi = NULL,
tau2 = NULL,
heterogeneity = "none",
alternative = "none",
check_inputs = TRUE,
w = rep(1, length(estimates)),
distr = "chisq"
)
p_wilkinson(
estimates,
SEs,
mu,
phi = NULL,
tau2 = NULL,
heterogeneity = "none",
alternative = "none",
check_inputs = TRUE,
input_p = "greater"
)
p_pearson(
estimates,
SEs,
mu = 0,
phi = NULL,
tau2 = NULL,
heterogeneity = "none",
check_inputs = TRUE,
input_p = "greater"
)
p_tippett(
estimates,
SEs,
mu = 0,
phi = NULL,
tau2 = NULL,
heterogeneity = "none",
check_inputs = TRUE,
input_p = "greater"
)
p_stouffer(
estimates,
SEs,
mu = 0,
phi = NULL,
tau2 = NULL,
heterogeneity = "none",
alternative = "two.sided",
check_inputs = TRUE,
w = NULL
)
estimates |
Numeric vector of effect estimates. |
SEs |
Numeric vector containing the standard errors of the effect estimates. |
mu |
A numeric vector containing null hypothesis value(s). |
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. |
alternative |
Either |
check_inputs |
Either |
approx |
Must be either TRUE (default) or FALSE. If TRUE, the p-value is
computed using the normal approximation of the Irwin-Hall distribution
whenever |
input_p |
Either |
w |
Numeric vector of weights. |
distr |
The distribution to use for the calculation of the p-value. Currently, the options are
|
The corresponding p-values given mu
under the null-hypothesis.
Add references to p-value statistics.
# Simulating estimates and standard errors
n <- 15
estimates <- rnorm(n)
SEs <- rgamma(n, 5, 5)
# Calculate the between-study variance tau2
tau2 <- estimate_tau2(estimates = estimates, SEs = SEs)
phi <- estimate_phi(estimates = estimates, SEs = SEs)
# 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 = 1e5
)
# Using Edgington's method to calculate the combined p-value
# for each of the means with additive adjustement for SEs
p_edgington(
estimates = estimates,
SEs = SEs,
mu = mu,
heterogeneity = "additive",
tau2 = tau2
)
# Using Fisher's method to calculate the combined \emph{p}-value
# for each of the means with multiplicative adjustement for SEs
p_fisher(
estimates = estimates,
SEs = SEs,
mu = mu,
heterogeneity = "multiplicative",
phi = phi
)
# Using the harmonic mean method to calculate the combined p-value
# for each of the means with additive adjustment for SEs.
p_hmean(
estimates = estimates,
SEs = SEs,
mu = mu,
heterogeneity = "additive",
tau2 = tau2,
distr = "chisq"
)
# Using Wilkinson's method to calculate the combined p-value
# for each of the means with multiplicative adjustement for SEs
p_wilkinson(
estimates = estimates,
SEs = SEs,
mu = mu,
heterogeneity = "multiplicative",
phi = phi
)
# Using Pearson's method to calculate the combined p-value
# for each of the means with multiplicative adjustement for SEs
p_pearson(
estimates = estimates,
SEs = SEs,
mu = mu,
heterogeneity = "multiplicative",
phi = phi
)
# Using Tippett's method to calculate the combined p-value
# for each of the means with multiplicative adjustement for SEs
p_tippett(
estimates = estimates,
SEs = SEs,
mu = mu,
heterogeneity = "multiplicative",
phi = phi
)
# Using weighted Stouffer's method to calculate the combined p-value for
# each of the means with multiplicative adjustement for SEs
p_stouffer(
estimates = estimates,
SEs = SEs,
mu = mu,
heterogeneity = "multiplicative",
phi = phi
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.