File: samplesize.bin.Rd

package info (click to toggle)
hmisc 4.2-0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,332 kB
  • sloc: asm: 27,116; fortran: 606; ansic: 411; xml: 160; makefile: 2
file content (64 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
\name{samplesize.bin}
\alias{samplesize.bin}
\title{
  Sample Size for 2-sample Binomial
}
\description{
  Computes sample size(s) for 2-sample binomial problem given vector or
  scalar probabilities in the two groups.
}
\usage{
samplesize.bin(alpha, beta, pit, pic, rho=0.5)
}
\arguments{
  \item{alpha}{
    scalar ONE-SIDED test size, or two-sided size/2
  }
  \item{beta}{
    scalar or vector of powers
  }
  \item{pit}{
    hypothesized treatment probability of success
  }
  \item{pic}{
    hypothesized control probability of success
  }
  \item{rho}{
    proportion of the sample devoted to treated group (\eqn{0 <\code{rho} < 1})
  }
}
\value{
  TOTAL sample size(s)
}
\section{AUTHOR}{
  Rick Chappell\cr
  Dept. of Statistics and Human Oncology\cr
  University of Wisconsin at Madison\cr
  \email{chappell@stat.wisc.edu}
}
\examples{
alpha <- .05
beta <- c(.70,.80,.90,.95)


# N1 is a matrix of total sample sizes whose
# rows vary by hypothesized treatment success probability and
# columns vary by power
# See Meinert's book for formulae.


N1 <- samplesize.bin(alpha, beta, pit=.55, pic=.5)
N1 <- rbind(N1, samplesize.bin(alpha, beta, pit=.60, pic=.5))
N1 <- rbind(N1, samplesize.bin(alpha, beta, pit=.65, pic=.5))
N1 <- rbind(N1, samplesize.bin(alpha, beta, pit=.70, pic=.5))
attr(N1,"dimnames") <- NULL


#Accounting for 5\% noncompliance in the treated group
inflation <- (1/.95)**2
print(round(N1*inflation+.5,0))
}
\keyword{htest}
\keyword{category}
\concept{study design}
\concept{power}