R/each.Stouffer.test.R

each.Stouffer.test <-
function (p, w) 
{
    if (missing(w)) {
        w <- rep(1, length(p))/length(p)
    }
    else {
        if (length(w) != length(p)) 
            stop("Length of p and w must equal!")
    }
    Zi <- qnorm(1 - p)
    Z <- sum(w * Zi)/sqrt(sum(w^2))
    pval <- 1 - pnorm(Z)
    return(pval)
}

Try the metaSeq package in your browser

Any scripts or data that you put into this service are public.

metaSeq documentation built on Nov. 8, 2020, 7:26 p.m.