wilcoxon: Wilcoxon test statistic, with optional weights.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/wilcoxon.R

Description

Calculate a Wilcoxon two group rank test statistic, with optional propensity score weighting.

Usage

1
  wilcoxon(p, snps.in, weights = NULL, binsize = 0.05)

Arguments

p

a numeric vector of observed p values from a list of SNPs or a matrix, with each column representing a vector under a different permutation of the dataset.

snps.in

a numeric vector indicating which members of p form the test group (their complement form the control group).

weights

optional propensity score weights. These are binned according to binsize, and a weight calculated which is inversely proportional to the probability of sampling a member of the test group in that bin.

binsize

see weights, above.

Value

A numeric value or, if p is a matrix, a numeric vector.

Author(s)

Chris Wallace

References

Propensity weights are described

Rosenbaum, P. R. & Rubin, D. B. The central role of the propensity score in observational studies for causal effects. Biometrika, 1983, 70, 41-55

Rosenbaum, P. R. Model-based direct adjustment. Journal of the American Statistical Association, 1987, 82, 387-394

See Also

Z.value

Examples

1
2
3
4
5
6
x <- exp(-rexp(1000)) # uniform
y <- exp(-rexp(1000,0.8)) # skewed towards 0
wilcoxon(p=c(x,y),snps.in=1:1000)

## note, should be equal to
wilcox.test(x,y)

Example output

Loading required package: snpStats
Loading required package: survival
Loading required package: Matrix
[1] 538808

	Wilcoxon rank sum test with continuity correction

data:  x and y
W = 538810, p-value = 0.002653
alternative hypothesis: true location shift is not equal to 0

wgsea documentation built on May 29, 2017, 7:02 p.m.