Description Usage Arguments Details Value Author(s) References See Also Examples
This function performs the Wtest
to calculate highorder interactions in casecontrol studies
for categorical data sets. The test measures target variables' distributional difference between cases and controls via a combined
log of odds ratio. It follows a Chisquared probability distribution with dataadaptive degrees of freedom. For highorder interaction
calculation, the user has 3 options: (1) calculate Wtest of a set of SNPs, (2) calculate highorder interaction for a list of variables,
which pvalues are smaller than a threshold (input.pval
); (3) calculate highorder interaction exhaustively for all variables.
Output can be filtered by pvalues, such that only sets with smaller pvalue than a threshold (output.pval
) will be returned.
1 2 3 
data 
a data frame or matrix containing genotypes in the columns. Genotypes should be coded as (0, 1, 2) or (0, 1). 
y 
a numeric vector of 0 or 1, or a factor variable with two levels. 
w.order 
an integer value, indicating the order of highway interactions. For example, 
hf1 
h and f values to calculate main effect, organized as a matrix, with columns (k, h, f), k = 2 to 3. 
hf.high.order 
h and f values to calculate highorder interactions, organized as a matrix, with columns (k, h, f), where k is the number of genotype combinations of a set of SNPs. 
which.marker 
a numeric vector indicating the column index of a set of SNPs to calculate. Default 
output.pval 
a pvalue threshold for filtering the output. If NULL, all the results will be listed; otherwise, the function will only output the results with pvalues smaller than the 
sort 
a logical value indicating whether or not to sort the output by pvalues in ascending order. Default = TRUE. 
input.pval 
a pvalue threshold to select markers for highorder interaction calculation, used only when 
input.poolsize 
an integer, with value less than the number of input variables. It is an optional filter to control the maximum number of variables to include in highorder interaction calculation, used only when 
Wtest is a modelfree statistical test orginally proposed to measure main effect or pairwise interactions in casecontrol studies with categorical variables. It can be extended to highorder interaction detection by the wtest.high() function. Theoretically, the test statistic follows a Chisquared distribution with f degrees of freedom. The dataadaptive degree of freedom f, and a scalar h in the test statistics allow the Wtest to correct for distributional bias due to sparse data and small sample size. Let k be the number of columns of the 2 by k contingency table formed by a single variable or a variable pair. When the sample size is large and there is no population stratification, the h and f will approximate well to the theoretical value h = (k1)/k, and f = k1. When sample size is small and there is population stratification, the h and f will vary to correct for distributional bias caused by the data structure.
When w.order
> 2, the wtest()
will automatically calculate the main effect first and then do a prefilter before calculating interactions.
This filtering is to avoid overloading the memory before having a better understanding of the data. User can specify a smaller input.pval such as 0.05 or 0.001
for less output, or input.pval
=1 or NULL for exhaustive highorder interaction calculation. Another optional filter is input.poolsize
. It will select the top input.poolsize
number of variables, ranked by pvalues, to calculate highorder interactions. When used together with input.pval
, the algorithm selects the smaller set in the highorder calculation.
An object "wtest"
containing:
order 
the "w.order" specified. 
results 
When order > 2 and which.marker = NULL, the test results include: (information of a set) [SNPs name, Wvalue, k, pvalue]; (Information of the first variable in the set) [Wvalue, k, pvalue]; (Information of the second variable in the set) [Wvalue, k, pvalue] ... 
hf1 
The h and f values used in main effect calculation. 
hf2 
The h and f values used in highorder interaction calculation. 
Rui Sun, Maggie Haitian Wang
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 Wtest for pairwise epistasis testing. Nucleic Acids Research. doi:10.1093/nar/gkw347.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  data(diabetes.geno)
data(phenotype1)
## Step 1. HF Calculation
# Please note that parameter B is recommended to be greater than 400 for w.order = 1 or 2.
# For high order interaction analysis (w.order > 2), it is recommended to use default n.sample.
hf1 < hf(data = diabetes.geno, w.order = 1, B = 100)
hf.high < hf(data = diabetes.geno, w.order = 3, B = 30, n.marker = 10)
## Step 2. Wtest Calculation
w1 < wtest.high(diabetes.geno, phenotype1, w.order = 1, hf1 = hf1)
w3 < wtest.high(diabetes.geno, phenotype1, w.order = 3, input.pval = 0.3,
input.poolsize = 50, output.pval = 0.5, hf1 = hf1, hf.high.order = hf.high)
w.set < wtest.high(diabetes.geno, phenotype1, w.order = 3, which.marker = c(10,13,20),
hf.high.order = hf.high)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.