\HeaderA{twPERM}{A function to compute a permutation test on a two way table.h}{twPERM}
\aliasA{makeBinVect}{twPERM}{makeBinVect}
\aliasA{twowayPERM}{twPERM}{twowayPERM}
\keyword{datagen}{twPERM}
\begin{Description}\relax
This function takes the entries of a two-way table and creates
two binary logical vectors upon which it computes a permutation
test to check for independence.
\end{Description}
\begin{Usage}
\begin{verbatim}
twowayPERM( v1, v2, NPERM, stat, seed = 123)
makeBinVect(n11, n12, n21, n22)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{v1}] A logical vector.
\item[\code{v2}] A logical vector the same length as v1.
\item[\code{NPERM}] A positive integer. The number of tests to be conducted.
\item[\code{stat}] A statistical function passed into to test the
permutation on two vectors.
\item[\code{seed}] A positive integer. To set the seed for the random number
generator.
\item[\code{n11}] A postive integer. The value of (1,1) in the two way table.
\item[\code{n12}] A postive integer. The value of (1,2) in the two way table.
\item[\code{n21}] A postive integer. The value of (2,1) in the two way table.
\item[\code{n22}] A postive integer. The value of (2,2) in the two way table.
\end{ldescription}
\end{Arguments}
\begin{Value}
A numeric vector containing the p-values for the test that
the permutation of the vector v1 is independent from v2.
\end{Value}
\begin{Author}\relax
T Chiang
\end{Author}
\begin{Examples}
\begin{ExampleCode}
x <- makeBinVect(13, 17, 23, 71)
\end{ExampleCode}
\end{Examples}

