Description Usage Arguments Details Value References Examples
association.test performs association tests at each predictor and returns both the test statistics and p-values. The Wald test can be employed for quantitative traits. The score or Lagrange multiplier test can be employed for both quantitative and qualitative traits. (See ‘Details’.)
1 | association.test(X, y, method = "score", trait = NULL)
|
X |
n-by-d matrix of predictors (genotypes) for n samples and d variables (SNPs). |
y |
Response (phenotype / (disease) trait). |
method |
Association test to be used. See ‘Details’. |
trait |
Quantitative or qualitative trait. If it is NULL, qualitative is automatically used if there are 2 unique response values, and quantitative otherwise. |
Method "score" uses a Lagrange multiplier or score test, computed under the null model. Method "Wald" uses a Wald's test or t-test for quantitative traits, computed under the unrestricted model. Wald's test is not recommended for qualitative traits, due to potential inefficiency of the Wald's test under logistic regression (Hauck and Donner 1977).
Trait "qualitative" is based on logistic regression. Trait "quantitative" is based on linear regression. See Kim et al. (2014).
test.stat |
d-vector of test statistics at each SNP. |
p.value |
d-vector of p-values at each SNP. |
Kim, S., Pan W., and Shen, X. (2014) Penalized regression approaches to testing for quantitative trait-rare variant association. Frontiers in Genetics, 5:121.
Hauck, W.W. and Donner, A. (1977) Wald's test as applied to hypotheses in logit analysis. J Am Stat Assoc, 72, 851-853.
1 2 3 4 5 6 7 8 9 10 11 12 | # Load "AFNC" library and example data.
library("AFNC")
data(example_data)
# Simulate response and predictors
set.seed(1); d = 10000; n = 2000
X = array(rnorm(n*d),c(n,d))
y = X[,1:50] %*% (1:50/10) + rnorm(n)
# Performs Wald's test
obj = association.test(X, y, method="Wald")
p.value = obj$p.value; test.stat = obj$test.stat
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.