\Header{power.prop.test}{Power calculations two sample test for of proportions}
\keyword{htest}{power.prop.test}
\begin{Description}\relax
Compute power of test, or determine parameters to obtain target power.\end{Description}
\begin{Usage}
\begin{verbatim}
power.prop.test(n=NULL, p1=NULL, p2=NULL, sig.level=0.05,
                power=NULL,
                alternative=c("two.sided", "one.sided"), strict=FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{n}] Number of observations (per group)
\item[\code{p1}] probability in one group
\item[\code{p2}] probability in other group
\item[\code{sig.level}] Significance level (Type I error probability)
\item[\code{power}] Power of test (1 minus Type II error probability)
\item[\code{alternative}] One- or two-sided test
\item[\code{strict}] Use strict interpretation in two-sided case
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Exactly one of the parameters \code{n}, \code{p1}, \code{p2},
\code{power}, and \code{sig.level} must be passed as NULL, and that
parameter is determined from the others. Notice that \code{sig.level}
has a non-NULL default so NULL must be explicitly passed if you want
it  computed.

If \code{strict=TRUE} is used, the power will include the probability of
rejection in the opposite direction of the true effect, in the two-sided 
case. Without this the power will be half the significance level if the 
true difference is zero.\end{Details}
\begin{Value}
Object of class \code{"power.htest"}, a list of the arguments
(including the computed one) augmented with \code{method} and
\code{note} elements.\end{Value}
\begin{Note}\relax
\code{uniroot} is used to solve power equation for unknowns, so
you may see errors from it, notably about inability to bracket the
root when invalid arguments are given. If one of them is computed
\code{p1 < p2} will hold, although this is not enforced when both are
specified.\end{Note}
\begin{Author}\relax
Peter Dalgaard.  Based on previous work by Claus Ekstrøm\end{Author}
\begin{SeeAlso}\relax
\code{\Link{prop.test}}, \code{\Link{uniroot}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
 power.prop.test(n=50, p1=.50, p2=.75)
 power.prop.test(p1=.50, p2=.75, power=.90)
 power.prop.test(n=50, p1=.5, power=.90)
\end{ExampleCode}
\end{Examples}

