| computeZmoment | R Documentation |
This function calculates the moments (mean and variance) of the adjusted Z statistic based on a given p-value support vector and a specified combination method.
computeZmoment(p_support, method = "fisher_mean")
p_support |
A numeric vector of p-values. Its elements must be nonnegative, nondecreasing, and not larger than 1. |
method |
The combination method that the adjusted Z statistic is related to. One of "fisher_mean" (default), "fisher_median", "pearson", "george", "stouffer", or "edgington". |
This function relies on the computeZ function to calculate the adjusted Z statistic for each element in p_support. The mean and variance are then computed based on these Z statistic values and their corresponding probabilities.
A list containing the mean (Zmean) and variance (Zvar) of the adjusted Z statistic.
methods <- c("fisher_mean", "fisher_median", "pearson", "george", "stouffer", "edgington")
# Toy example
p_support <- c(0.1, 0.2, 0.5, 1)
sapply(methods, function(m) computeZmoment(p_support, m))
# Example for p_support containing many 0's and 1's due to numerical limitations.
p_support <- pbinom(0:100000, size = 100000, prob = 0.7)
sapply(methods, function(m) computeZmoment(p_support, m))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.