\HeaderA{HWE.exact}{Exact test for Hardy-Weinberg Equilibrium for a biallelic locus}{HWE.exact}
\keyword{misc}{HWE.exact}
\begin{Description}\relax
Exact test for Hardy-Weinberg Equilibrium for a biallelic locus.
\end{Description}
\begin{Usage}
\begin{verbatim}
HWE.exact(object, 
          marker, 
          founderOnly=TRUE)

\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] a geneSet object.
\item[\code{marker}] marker name for the biallelic locus.
\item[\code{founderOnly}] Indicates if only founders are used to do the test.
\end{ldescription}
\end{Arguments}
\begin{Value}
The function \code{HWE} returns a list with class \code{htest} containing the following elements:
\begin{ldescription}
\item[\code{statistic}] A 3-element vector records the genotype frequencies: \code{N11}, \code{N12}, \code{N22}.
\item[\code{parameter}] A 2-element vector records the allele frequencies: \code{N1} and \code{N2}
\item[\code{p.value}] p-value of the test.
\item[\code{method}] Information indicates if \code{chisquare} method or \code{exact} method is used to do HWE test.
\item[\code{data.name}] name of the data set
\item[\code{observed}] a table lists allele levels, allele pairs, and allele codes
\end{ldescription}
\end{Value}
\begin{Note}\relax
This function only works for genotypes with exactly 2 alleles.
\end{Note}
\begin{Author}\relax
David Duffy davidD@qimr.edu.au with modifications by Gregory R.
Warnes, and Nitin Jain
\end{Author}
\begin{References}\relax
Emigh TH. (1980) "Comparison of tests for Hardy-Weinberg
Equilibrium", Biometrics, 36, 627-642.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{HWE.chisq}{HWE.chisq}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
library(GeneticsBase)
data(CAMP)

HWE.exact(CAMP, marker="m654")

\end{ExampleCode}
\end{Examples}

