\HeaderA{HWE}{Test the significances of Hardy-Weinberg Equilibrium (dis)equilibrium) statistics}{HWE}
\keyword{misc}{HWE}
\begin{Description}\relax
Test the significances of Hardy-Weinberg Equilibrium (dis)equilibrium) statistics for each marker in a data set.
\end{Description}
\begin{Usage}
\begin{verbatim}
HWE(object, 
    test = c("exact", "permutation", "chisq"), 
    B = 10000, 
    R = 1000, 
    correct = TRUE, 
    conf = c(0.95), 
    na.rm = TRUE, 
    founderOnly = TRUE, 
    ...) 
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] a geneSet object.
\item[\code{test}] specifys the test method. Available methods are \dQuote{exact},
\dQuote{permutation}, \dQuote{chisq}.
\item[\code{B}] an integer specifying the number of replicates used in the
Monte Carlo test. Defaults to 10000.
\item[\code{R}] Number of bootstrap iterations to use when computing the
confidence interval. Defaults to 1000.
\item[\code{correct}] see \code{\LinkA{diseq.ci}{diseq.ci}}.
\item[\code{conf}] Confidence level to use when computing the confidence level
for linkage disequilibrium measures.  Defaults to 0.95, should be in (0,1).
\item[\code{na.rm}] logical. Should missing values be removed?
\item[\code{founderOnly}] Indicates if only founders are used to do the test.
\item[\code{...}] othere arguments used by the function \code{\LinkA{chisq.test}{chisq.test}}.

\end{ldescription}
\end{Arguments}
\begin{Value}
The function \code{HWE} returns a list:
\begin{ldescription}
\item[\code{\bsl{}dQuote\{diseq\}}] a character string.
\item[\code{call}] the matched call.
\item[\code{\bsl{}dQuote\{D\}}] a matrix with $m$ rows and $3+p$ columns, where $m$ is the number of markers in the geneSet, $p$ is the number of elements of the argument \code{conf}. The first column is the estimated \dQuote{D}. The next $p$ columns are estimated confidence limits for the confidence levels specified in the argument \code{conf}. The last two columns are the sample size and the p-value of the test that \dQuote{D} is equal to zero.
\item[\code{\bsl{}dQuote\{D'\}}] a matrix with $m$ rows and $3+p$ columns, where $m$ is the number of markers in the geneSet, $p$ is the number of elements of the argument \code{conf}. The first column is the estimated \dQuote{D'}. The next $p$ columns are estimated confidence limits for the confidence levels specified in the argument \code{conf}. The last two columns are the sample size and the p-value of the test that \dQuote{D'} is equal to zero.
\item[\code{\bsl{}dQuote\{r\}}] a matrix with $m$ rows and $3+p$ columns, where $m$ is the number of markers in the geneSet, $p$ is the number of elements of the argument \code{conf}. The first column is the estimated \dQuote{r}. The next $p$ columns are estimated confidence limits for the confidence levels specified in the argument \code{conf}. The last two columns are the sample size and the p-value of the test that \dQuote{r} is equal to zero.
\item[\code{\bsl{}dQuote\{X\$\textasciicircum{}2\$\}}] a matrix with $m$ rows and $3+p$ columns, where $m$ is the number of markers in the geneSet, $p$ is the number of elements of the argument \code{conf}. The first column is the test statistic \dQuote{X$^2$} for HWE test. The next $p$ columns are zeros. The last two columns are the sample size and the p-value of the test for Hardy-Weinberg equilibrium.
\end{ldescription}
\end{Value}
\begin{Author}\relax
Gregory R. Warnes \email{gregory.r.warnes@pfizer.com} and Nitin Jain \email{nitin.jain@pfizer.com}
\end{Author}
\begin{Examples}
\begin{ExampleCode}
library(GeneticsBase)
data(CAMP)

HWE(CAMP)

\end{ExampleCode}
\end{Examples}

