Exact Binomial Test

DESCRIPTION:
Test hypothesises about the parameter p in a Binomial(n,p) model given x, the number of successes out of n trials.

USAGE:
binom.test(x, n, p=0.5, alternative="two.sided")

REQUIRED ARGUMENTS:
x:
number of successes.
n:
number of trials.

OPTIONAL ARGUMENTS:
p:
probability of success to be tested.
alternative:
alternative hypothesis, "two.sided" (not equal to p), "less" (less than p) or "greater" (greater than p).

VALUE:
a list with class attribute "htest", representing the result of binomial test:
statistic:
number of successes.
parameters:
number of trials.
p.value:
the p-value.
null.value:
null hypothesis value of the probability of success.
alternative:
alternative hypothesis.
method:
the string "Exact binomial test".
data.name:
a character vector describing the data used for the test.

DETAILS:
The exact probabilities are computed for the binomial distribution.

NULL:
The probability of success is equal to p.

ASSUMPTIONS:
x is the number of successes out of n independent trials, each with the same probability of success.

REFERENCES:
Conover, W. J. (1980). Practical Nonparametric Statistics, 2nd ed. Wiley, New York.

SEE ALSO:
Binomial .

EXAMPLES:
x <- rnorm(100)
y <- sum(x>0)
binom.test(y, 100) # median == 0 ?

y <- rnorm(100) d <- x - y binom.test(sum(d>0),length(d)) # sign test