Learn R Programming

wgsea (version 1.8)

Z.value: Calculate a Z score from a Wilcoxon statistic and a set of random Wilcoxon statistics

Description

The mean of a Wilcoxon statistic is unaffected by correlation within the variable under test, but its variance is. This function uses a set of Wilcoxon statistics generated from permuted data to estimate the variance empirically, and thus calculate a Z score.

Usage

Z.value(W, Wstar, n.in, n.out)

Arguments

W
Wilcoxon statistic for observed data.
Wstar
A vector of Wilcoxon statistics for a set of permuted data.
n.in
The number of items (SNPs) in the regions to be tested.
n.out
The number of items (SNPs) in the control regions.

Value

A list with two elements:

See Also

wilcoxon

Examples

Run this code
x <- exp(-rexp(1000)) # uniform
y <- exp(-rexp(1000,0.8)) # skewed towards 0
W <- wilcoxon(p=c(x,y),snps.in=1:1000)

p.perm <- matrix(sample(c(x,y),replace=TRUE,size=10000),ncol=5)
Wstar <- wilcoxon(p=p.perm,snps.in=1:1000)

Z.value(W=W, Wstar=Wstar, n.in=1000, n.out=1000)

Run the code above in your browser using DataLab