binom.test {ctest} | R Documentation |
Performs an exact test of the null that the probability of success in
a Bernoulli experiment of length n
is p
, based on the
number x
of successes observed.
binom.test(x, n, p = 0.5, alternative = c("two.sided", "less", "greater"), conf.level = 0.95)
x |
number of successes. |
n |
number of trials. |
p |
probability of success. |
alternative |
indicates the alternative hypothesis and must be
one of "two.sided" , "greater" or "less" .
You can specify just the initial letter. |
conf.level |
confidence level for the returned confidence interval. |
"htest"
containing the following components:
statistic |
the number of successes, x . |
parameter |
the number of trials, n . |
p.value |
the p-value of the test. |
conf.int |
a confidence interval for the probability of success. |
estimate |
the estimated probability of success, x / n . |
null.value |
the probability of success under the null,
p . |
alternative |
a character string describing the alternative hypothesis. |
method |
the string "Exact binomial test" . |
data.name |
a character string giving the names of the data. |
Conover, W. J. (1971), Practical nonparametric statistics. New York: John Wiley & Sons. Pages 97104.
Myles Hollander & Douglas A. Wolfe (1973), Nonparametric statistical inference. New York: John Wiley & Sons. Pages 1522.
prop.test
for a general (approximate) test for equal or
given proportions.
## Conover (1971), p. 97f. ## Under (the assumption of) simple Mendelian inheritance, a cross ## between plants of two particular genotypes produces progeny 1/4 of ## which are ``dwarf'' and 3/4 of which are ``giant'', respectively. ## In an experiment to determine if this assumption is reasonable, a ## cross results in progeny having 243 dwarf and 682 giant plants. ## If ``giant'' is taken as success, the null hypothesis is that p = ## 3/4 and the alternative that p != 3/4. binom.test(682, 682 + 243, p = 3/4) ## => Data are in agreement with the null hypothesis.