computeZmoment: Compute Moments of Adjusted Z Statistic

View source: R/calcu_adjZ.R

computeZmomentR Documentation

Compute Moments of Adjusted Z Statistic

Description

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.

Usage

computeZmoment(p_support, method = "fisher_mean")

Arguments

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".

Details

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.

Value

A list containing the mean (Zmean) and variance (Zvar) of the adjusted Z statistic.

Examples

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))

DPComb documentation built on Aug. 22, 2026, 5:08 p.m.