R: MAX CATT test in case-control genetic association analysis
Exact Max CATT Test
R Documentation
MAX CATT test in case-control genetic association analysis
Description
Perform exact MAX3 test, MAX2 test and Cochran-Armitage trend test for
one-locus genetic association analysis. MAX3 is the maximum of the
Cochran-Armitage trend test statistic for dominant, recessive and
additive models, and MAX2 is the maximum of dominant and recessive
models.
It also provides approximated p-value of a MAX test with the normal
approximation method.
Usage
maxact.test(data, max3 = TRUE, exact=TRUE, alternative = "two.sided")
catt.test(data, theta, exact=TRUE, alternative = "two.sided")
Arguments
data
2x3 contingency table of data values, with rows
representing case/control, and columns representing the three
genotypes
max3
a logical indicating whether MAX3 or MAX2 test statistic
should be used
theta
parameter of the Cochran-Armitage trend test
exact
a logical indicating whether an exact p-value should be
computed
alternative
a character string describing the alternative
hypothesis, which must be one of '"two.sided"', '"greater"' or
'"less"'
Value
A list with class '"htest"' containing the following components:
data.name
a character string giving the names of the data.
p.value
the p-value of the test.
method
a character string describing the method used.
statistic
the value of the test statistic.
alternative
a character string describing the alternative hypothesis.
Note
The normal approximation method(exact=FALSE) is provided for
comparison purpose, and is not recommended for data analysis. The
exact method is faster than the normal approximation method in most of
cases, and it is fast enough for most of applications.
Tian, J., Xu, C., Zhan, H., Yang, Y. (2009) "Exact MAX
tests in case-control association analysis (Manuscript)."
Examples
data.sladek <- matrix(c(129, 326, 229, 198, 325, 143), 2, 3, byrow=TRUE)
## MAX3 test (exact p-value)
maxact.test(data.sladek)
## MAX2 test (exact p-value):
maxact.test(data.sladek, max3=FALSE, exact=TRUE)
## MAX test (p-value calculated from the normal approximation method), it
## is not recommends, see NOTE for more information
maxact.test(data.sladek, max3=TRUE, exact=FALSE)
maxact.test(data.sladek, max3=FALSE, exact=FALSE)
## Cochran-Armitage trend test, assuming we know the model
catt.test(data.sladek, theta=0) #recessive model
catt.test(data.sladek, theta=0.5) #additive model
catt.test(data.sladek, theta=1) #dominant model
#the alternative hypothesis is less
catt.test(data.sladek, theta=0, alternative="less")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MaXact)
Loading required package: mnormt
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MaXact/maxact.Rd_%03d_medium.png", width=480, height=480)
> ### Name: Exact Max CATT Test
> ### Title: MAX CATT test in case-control genetic association analysis
> ### Aliases: MaXact maxact.test catt.test
> ### Keywords: htest
>
> ### ** Examples
>
> data.sladek <- matrix(c(129, 326, 229, 198, 325, 143), 2, 3, byrow=TRUE)
>
> ## MAX3 test (exact p-value)
> maxact.test(data.sladek)
Exact MAX3 test
data: data.sladek (2x3 contingency table)
max3 = 5.8467, p-value = 1.288e-08
alternative hypothesis: two.sided
>
> ## MAX2 test (exact p-value):
> maxact.test(data.sladek, max3=FALSE, exact=TRUE)
Exact MAX2 test
data: data.sladek (2x3 contingency table)
max2 = 4.937, p-value = 1.436e-06
alternative hypothesis: two.sided
>
>
> ## MAX test (p-value calculated from the normal approximation method), it
> ## is not recommends, see NOTE for more information
> maxact.test(data.sladek, max3=TRUE, exact=FALSE)
MAX3 test (normal approximation)
data: data.sladek (2x3 contingency table)
max3 = 5.8467, p-value = 8.915e-09
alternative hypothesis: two.sided
> maxact.test(data.sladek, max3=FALSE, exact=FALSE)
MAX2 test (normal approximation)
data: data.sladek (2x3 contingency table)
max2 = 4.937, p-value = 1.586e-06
alternative hypothesis: two.sided
>
> ## Cochran-Armitage trend test, assuming we know the model
> catt.test(data.sladek, theta=0) #recessive model
Exact Cochran-Armitage trend test with theta 0
data: data.sladek (2x3 contingency table)
CATT(0) = -4.937, p-value = 7.758e-07
alternative hypothesis: two.sided
> catt.test(data.sladek, theta=0.5) #additive model
Exact Cochran-Armitage trend test with theta 0.5
data: data.sladek (2x3 contingency table)
CATT(0.5) = -5.8467, p-value = 4.879e-09
alternative hypothesis: two.sided
> catt.test(data.sladek, theta=1) #dominant model
Exact Cochran-Armitage trend test with theta 1
data: data.sladek (2x3 contingency table)
CATT(1) = -4.6607, p-value = 3.351e-06
alternative hypothesis: two.sided
>
> #the alternative hypothesis is less
> catt.test(data.sladek, theta=0, alternative="less")
Exact Cochran-Armitage trend test with theta 0
data: data.sladek (2x3 contingency table)
CATT(0) = -4.937, p-value = 4.967e-07
alternative hypothesis: less
>
>
>
>
>
>
>
> dev.off()
null device
1
>