Learn R Programming

AssocTests (version 1.0-1)

max3: Maximum Test: maximum value of the three Cochran-Armitage trend tests under the recessive, additive, and dominant models

Description

Conduct MAX3 (the maximal value of the three Cochran-Armitage trend tests derived for the recessive, additive, and dominant models) based on the trend tests without the adjustment of the covariates or based on the Wald tests with the adjustment of the covariates to test for the association between a single-nucleotide polymorphism and the binary phenotype.

Usage

max3(
  y,
  g,
  covariates = NULL,
  Score.test = TRUE,
  Wald.test = FALSE,
  rhombus.formula = FALSE
)

Arguments

y

a numeric vector of the observed trait values in which the ith element is for the ith subject. The elements should be 0 or 1.

g

a numeric vector of the observed genotype values (0, 1, or 2 denotes the number of risk alleles) in which the ith element is for the ith subject. The missing value is represented by NA. g has the same length as y.

covariates

a numeric matrix for the covariates used in the model. Each column is for one covariate. The default is NULL, that is, there are no covariates to be adjusted for.

Score.test

logical. If TRUE, the score tests are used. One of Score.test and Wald.test should be FALSE, and the other should be TRUE. The default is TRUE.

Wald.test

logical. If TRUE, the Wald tests are used. One of Score.test and Wald.test should be FALSE, and the other should be TRUE. The default is FALSE.

rhombus.formula

logical. If TRUE, the p-value for the MAX3 is approximated by the rhombus formula. IF FALSE, the 2-fold integration is used to calculate the p-value. The default is FALSE.

Value

A list with class "htest" containing the following components:

statistic
the observed value of the test statistic.
p.value
the p-value for the test.
alternative
a character string describing the alternative hypothesis.
method
a character string indicating the type of test performed.
data.name

Details

In an association study, the genetic inheritance models (recessive, additive, or dominant) are unknown beforehand. This function can account for the uncertainty of the underlying genetic models and test for the association between a single-nucleotide polymorphism and a binary phenotype with or without correcting for the covariates.

References

Lin Wang, Wei Zhang, and Qizhai Li. AssocTests: An R Package for Genetic Association Studies. Journal of Statistical Software. 2020; 94(5): 1-26.

Q Li, G Zheng, Z Li, and K Yu. Efficient Approximation of P Value of the Maximum of Correlated Tests, with Applications to Genome-Wide Association Studies. Annals of Human Genetics. 2008; 72(3): 397-406.

Examples

Run this code
# NOT RUN {
y <- rep(c(0, 1), 5)
g <- sample(c(0, 1, 2), 10, replace = TRUE)
max3(y, g, covariates = NULL, Score.test = TRUE, Wald.test = FALSE,
       rhombus.formula = FALSE)
max3(y, g, covariates = matrix(sample(c(0,1), 20, replace = TRUE), ncol=2),
       Score.test = TRUE, Wald.test = FALSE, rhombus.formula = FALSE)
# }

Run the code above in your browser using DataLab