\HeaderA{Armitage}{Cochran-Armitage test for linear trends in proportions and frequencies}{Armitage}
\methaliasA{Armitage.default}{Armitage}{Armitage.default}
\aliasA{ArmitageTest}{Armitage}{ArmitageTest}
\keyword{misc}{Armitage}
\begin{Description}\relax
Cochran-Armitage test for linear trends in proportions and frequencies.
\end{Description}
\begin{Usage}
\begin{verbatim}
Armitage(geneSetObj, method="A")
Armitage.default(pedObj, method="A")
ArmitageTest(x, mem)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{geneSetObj}] a geneSet object
\item[\code{pedObj}] a pedigree object
\item[\code{method}] genotype coding method. The default is additive coding (\code{A}). The other two available coding methods are recessive coding (\code{R}) and dominant coding (\code{D}), respectively.
\item[\code{x}] a vector of bialleleic markers coded by additive, recessive, or dominant model.
Denote B as common allele and A as minor allele.
\item[additive model:] x=0 -- BB; x=1 -- AB; x=2 -- AA
\item[recessive model:] x=0 -- BB; x=0 -- AB; x=2 -- AA
\item[dominant model:] x=0 -- BB; x=1 -- AB; x=1 -- AA

\item[\code{mem}] disease membership. \code{1} -- case; \code{0} -- control
\end{ldescription}
\end{Arguments}
\begin{Value}
The functions \code{Armitage} and \code{Armitage.default} return a matrix with \code{nMarkers} rows and 2 columns, where \code{nMarkers} is the number of markers. The two columns are test statistic (\code{stat}) and p-value (\code{pvalue}), respectively.

The function \code{ArmitageTest} returns a list of two elements:
\begin{ldescription}
\item[\code{stat }] test statistic
\item[\code{pvalue }] p-value of the test
\end{ldescription}
\end{Value}
\begin{Note}\relax
This implementation is based on the documentation at webpage:
\url{http://linkage.rockefeller.edu/pawe3d/help/Linear-trend-test-ncp.html}.
\end{Note}
\begin{Author}\relax
Gregory Warnes <warnes@bst.rochester.edu>
Ross Lazarus <ross.lazarus@channing.harvard.edu>
Weiliang Qiu <stwxq@channing.harvard.edu>
\end{Author}
\begin{References}\relax
Gordon D, Haynes C, Blumenfeld J, Finch SJ (2005) 
PAWE-3D: visualizing Power for Association With Error in case/control 
genetic studies of complex traits. 
Bioinformatics 21:3935-3937.

Gordon D, Finch SJ, Nothnagel M, Ott J (2002) 
Power and sample size calculations for case-control genetic association 
tests when errors are present: application to single nucleotide 
polymorphisms. 
Hum Hered 54:22-33.

Chapman, D.G. and Nam, J.M. (1968) 
Asymptotic power of chi square tests for linear trends in proportions. 
Biometrics. 24, 315-327.

Armitage, P. (1955) 
Tests for linear trends in proportions and frequencies. 
Biometrics. 11, 375-386.

Cochran, W.G. (1954) 
Some methods for strengthening the common chi-squared tests. 
Biometrics. 10, 417-451.
\end{References}
\begin{Examples}
\begin{ExampleCode}
  # not significant result
  ArmitageTest(x=c(2,1,1,1,0,0,1,0,0,1), mem=c(1,1,1,1,1,0,0,0,0,0))

  # significant result
  ArmitageTest(x=c(2,2,1,1,0,0,0,0,0,0), mem=c(1,1,1,1,1,0,0,0,0,0))

\end{ExampleCode}
\end{Examples}

