w.diagnosis {wtest}R Documentation

W-test Probability Distribution Diagnostic Plot

Description

Diagnostic checking of W-test probability distribution estimation.

Usage

w.diagnosis(data, w.order = c(1, 2), n.rep = 10,
  n.sample = nrow(data), n.marker = ncol(data), hf1 = "default.hf1",
  hf2 = "default.hf2", ...)

Arguments

data

a data frame or matrix containing genotypes in the columns. Genotypes should be coded as (0, 1, 2) or (0, 1).

w.order

an integer value of 0 or 1. w.order = 1 gives main effect calculation; w.order = 2 gives pairwise calculation.

n.rep

a numeric value, the number of bootstrapping times.

n.sample

a numeric value, the number of samples to use in bootstrapping. Default is the total number of samples in the data.

n.marker

a numeric value, the number of markers to use in bootstrapping. Default is the total number of markers.

hf1

h and f values to calculate main effect, organized as a matrix, with columns (k, h, f), k = 2 to 3. Needed when w.order = 1.

hf2

h and f values to calculate interaction associations, organized as a matrix, with columns (k, h, f), k = 2 to 9. Needed when w.order = 2.

...

graphical parameters.

Details

This function evaluates the input W values of main or interaction effects using a set of null Y by the W-test, and the evaluation is performed in several bootstrap samples to achieve fast and stable output. The W histogram and its theoretical Chi-squared distribution density with f degrees of freedom are plotted indexed by k. Close overlaying of the histogram and the probability density curve indicates that the estimated h and f give a good test statistic probability distribution.

Author(s)

Rui Sun, Maggie Haitian Wang

References

Maggie Haitian Wang, Rui Sun, Junfeng Guo, Haoyi Weng, Jack Lee, Inchi Hu, Pak Sham and Benny C.Y. Zee (2016). A fast and powerful W-test for pairwise epistasis testing. Nucleic Acids Research. doi:10.1093/nar/gkw347.

See Also

wtest, hf, w.qqplot

Examples

data(diabetes.geno)
# Please note that parameter B is recommended to be greater than 400.
hf1 <- hf(data = diabetes.geno, w.order = 1, B = 100)
hf2 <- hf(data = diabetes.geno, w.order = 2, B = 50)
w.diagnosis(diabetes.geno, w.order = 1, n.rep = 100, hf1 = hf1, main=NULL, xlab=NULL, ylab=NULL)
w.diagnosis(diabetes.geno, w.order = 2, n.rep = 100, hf2 = hf2, main=NULL, xlab=NULL, ylab=NULL)

[Package wtest version 3.2 Index]