\HeaderA{power.casectrl}{Power for case-control genetics study}{power.casectrl}
\keyword{design}{power.casectrl}
\begin{Description}\relax
Calculate power for case-control genetics study
\end{Description}
\begin{Usage}
\begin{verbatim}
power.casectrl(N, gamma = 4.5, p = 0.15, kp = 0.1, alpha = 0.05, fc = 0.5, 
                minh = c("multiplicative", "dominant", "recessive"))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{N}] total number of subjects
\item[\code{gamma}] Relative risk in multiplicative model.  Not used in Dominant 
or Recessive model.
\item[\code{p}] frequency of A (protective) allele
\item[\code{kp}] significance level
\item[\code{alpha}] prevalence of disease 
\item[\code{fc}] fraction of cases 
\item[\code{minh}] mode of inheritance, one of  
\end{ldescription}
\end{Arguments}
\begin{Value}
power for the specified parameter values.
\end{Value}
\begin{Author}\relax
Michael Man
\end{Author}
\begin{References}\relax
Long, A. D. and C. H. Langley (1997). Genetic analysis of 
complex traits. Science 275: 1328.
\end{References}
\begin{Examples}
\begin{ExampleCode}

# single calc
power.casectrl(p=0.1, N=50, gamma=1.1, kp=.1, alpha=5e-2, minh='r')

# for a range of sample sizes
power.casectrl(p=0.1, N=c(25,50,100,200,500), gamma=1.1, kp=.1,
              alpha=5e-2, minh='r')

# create a power table
fun <- function(p)
  power.casectrl(p=p, N=seq(100,1000,by=100), gamma=1.1, kp=.1,
                alpha=5e-2, minh='recessive')

m <- sapply( X=seq(0.1,0.9, by=0.1), fun )
colnames(m) <- seq(0.1,0.9, by=0.1)
rownames(m) <- seq(100,1000,by=100)

print(round(m,2))
\end{ExampleCode}
\end{Examples}

