Learn R Programming

binGroup (version 2.2-1)

binTest: Hypothesis tests for One Binomial Proportion

Description

Calculates p-values for hypothesis tests of a single binomial proportion.

Usage

binTest(n, y, p.hyp, alternative = "two.sided",
 method = "Exact")

Arguments

n

single integer value, number of trials (number of individuals under observation)

y

single integer value, number of successes (number of individuals showing the trait of interest)

p.hyp

single numeric value between 0 and 1, specifying the hypothetical threshold proportion to test against

alternative

character string defining the alternative hypothesis, either 'two.sided', 'less' or 'greater'

method

character string defining the test method to be used: can be one of "Exact" for an exact test corresponding to the Clopper-Pearson confidence interval, uses binom.test(stats) "Score" for a Score test, corresponding to the Wilson confidence interval "Wald" for a Wald test corresponding to the Wald confidence interval

Value

A list containing:

p.value

the p value of the test

estimate

the estimated proportion

p.hyp

as input

alternative

as input

method

as input

References

Santner, T.J. and Duffy, D.E. (1989) The statistical analysis of discrete data. Springer Verlag New York Berlin Heidelberg. Chapter 2.1.

See Also

binom.test(stats) for the exact test and corresponding confindence interval

Examples

Run this code
# NOT RUN {
# 200 seeds are taken from a seed lot.
# 2 are found to be defective.
# H0: p >= 0.02  shall be rejected in favor of  HA: p < 0.02.
# The exact test shall be used for decision:

binTest(n=200, y=2, p.hyp=0.02, alternative="less", method="Exact" )

# }

Run the code above in your browser using DataLab