1\name{ciapower}
2\alias{ciapower}
3\title{
4Power of Interaction Test for Exponential Survival
5}
6\description{
7Uses the method of Peterson and George to compute the power of an
8interaction test in a 2 x 2 setup in which all 4 distributions are
9exponential.  This will be the same as the power of the Cox model
10test if assumptions hold.  The test is 2-tailed.
11The duration of accrual is specified
12(constant accrual is assumed), as is the minimum follow-up time.
13The maximum follow-up time is then \code{accrual + tmin}.  Treatment
14allocation is assumed to be 1:1.
15}
16\usage{
17ciapower(tref, n1, n2, m1c, m2c, r1, r2, accrual, tmin,
18         alpha=0.05, pr=TRUE)
19}
20\arguments{
21\item{tref}{
22time at which mortalities estimated
23}
24\item{n1}{
25total sample size, stratum 1
26}
27\item{n2}{
28total sample size, stratum 2
29}
30\item{m1c}{
31tref-year mortality, stratum 1 control
32}
33\item{m2c}{
34tref-year mortality, stratum 2 control
35}
36\item{r1}{
37\% reduction in \code{m1c} by intervention, stratum 1
38}
39\item{r2}{
40\% reduction in \code{m2c} by intervention, stratum 2
41}
42\item{accrual}{
43duration of accrual period
44}
45\item{tmin}{
46minimum follow-up time
47}
48\item{alpha}{
49type I error probability
50}
51\item{pr}{
52set to \code{FALSE} to suppress printing of details
53}}
54\value{
55power
56}
57\section{Side Effects}{
58prints
59}
60\section{AUTHOR}{
61Frank Harrell
62
63
64Department of Biostatistics
65
66
67Vanderbilt University
68
69
70\email{f.harrell@vanderbilt.edu}
71}
72\references{
73Peterson B, George SL: Controlled Clinical Trials 14:511--522; 1993.
74}
75\seealso{
76\code{\link{cpower}}, \code{\link{spower}}
77}
78\examples{
79# Find the power of a race x treatment test.  25\% of patients will
80# be non-white and the total sample size is 14000.
81# Accrual is for 1.5 years and minimum follow-up is 5y.
82# Reduction in 5-year mortality is 15\% for whites, 0\% or -5\% for
83# non-whites.  5-year mortality for control subjects if assumed to
84# be 0.18 for whites, 0.23 for non-whites.
85n <- 14000
86for(nonwhite.reduction in c(0,-5)) {
87  cat("\n\n\n\% Reduction in 5-year mortality for non-whites:",
88      nonwhite.reduction, "\n\n")
89  pow <- ciapower(5,  .75*n, .25*n,  .18, .23,  15, nonwhite.reduction,
90                  1.5, 5)
91  cat("\n\nPower:",format(pow),"\n")
92}
93}
94\keyword{survival}
95\keyword{htest}
96\concept{power}
97\concept{study design}
98