Learn R Programming

wtest (version 3.0)

w.diagnosis: Plots for w values diagnosis

Description

Function to plot the distribution of w values against its theoretical distribution for W-test diagnosis.

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 contains 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 for main effect calculation; w.order = 2, for pairwise calculation.

n.rep

a numeric value, the number of replicates.

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

a data frame or matrix, contains the h and f values for main effect (w.order =1) calculation at the number of categorical combinations (k) = 2 or 3. Default hf1 is h = k/(k-1) and f = k-1, where k = 2 to 3, in which the first row is the h and f for k = 2, and second row is the h and f for k = 3.

hf2

a data frame or matrix, contains the h and f values for pairwise interaction effect calculation (w.order=2) when k = 2 to 9. Default hf2 is h = k/(k-1) and f = k-1, where k = 2 to 9, the first row is the h and f for k = 2, and the last row is the h and f for k = 9.

...

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 plots the w values probabilities against its theoretical Chi-squared distribution density with f degrees of freedom indexed by k. Since h and f are dataset adaptive, estimated hf is strongly recommended.

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

Run this code
# NOT RUN {
data(mydata)
# Please note that parameter B is recommended to be greater than 400.
hf1<-hf(data = mydata, w.order = 1, B = 100)
hf2<-hf(data = mydata, w.order = 2, B = 50)
w.diagnosis(mydata, w.order = 1, n.rep = 100, hf1 = hf1, main=NULL, xlab=NULL, ylab=NULL)
w.diagnosis(mydata, w.order = 2, n.rep = 100, hf2 = hf2, main=NULL, xlab=NULL, ylab=NULL)
# }

Run the code above in your browser using DataLab