bin1samp: Sample Size for One-sample Exact Binomial Tests

View source: R/bin1samp.R

bin1sampR Documentation

Sample Size for One-sample Exact Binomial Tests

Description

Determines the minimum sample size for a one-sided, one-sample exact binomial test with specified alpha (type I) and beta (type II) errors

Usage

bin1samp(p0, pa, alpha = 0.1, beta = 0.1, n.min = 20L)

Arguments

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

Details

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.

Value

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.

See Also

print.bin1samp; pickwin; rp21; twostg; simon

Examples

bin1samp(0.9, 0.95, n.min = 100)
bin1samp(0.1, 0.05, n.min = 100)


raredd/desmon documentation built on May 7, 2024, 3:46 p.m.