bin1samp | R Documentation |
Determines the minimum sample size for a one-sided, one-sample exact binomial test with specified alpha (type I) and beta (type II) errors
bin1samp(p0, pa, alpha = 0.1, beta = 0.1, n.min = 20L)
p0 |
Null hypothesis response probability |
pa |
Alternative hypothesis response probability |
alpha |
Type I error rate |
beta |
Type II error rate |
n.min |
Minimum sample size considered |
Loops over sample sizes starting with n.min
, determines the critical
value for the exact test of size alpha, and calculates the type II error.
If the type II error is larger than beta
, increments the sample size
by 1 and tries again.
print.bin1samp
is a print method for the output of
bin1samp
.
bin1samp
returns a vector giving the minimum sample size
(n
), the critical value r
(reject if outcome is more extreme
than r
), the null and alternative response probabilities (p0
and pa
), and the type I and type II errors (size
and
type2
).)
No value is returned by print.bin1samp
, but it prints the input
p0
and pa
, the minimum sample size, the critical value
r
for the test that rejects if the number of responses is > r
if pa>p0
or that rejects if the number of responses is < r
if
pa<p0
, and the actual type I and type II error rates.
print.bin1samp
; pickwin
; rp21
;
twostg
; simon
bin1samp(0.9, 0.95, n.min = 100)
bin1samp(0.1, 0.05, n.min = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.