Last chance! 50% off unlimited learning
Sale ends in
binom.test
function performs an exact test of
a simple null hypothesis about the probability of success
in a Bernoulli experiment from summarized data or from
raw data. The mosaic binom.test
provides wrapper
functions around the function of the same name in
binom.test( x, n, p = 0.5, alternative = c("two.sided",
"less", "greater"), conf.level = 0.95,...) ## S3 method for class 'ANY':
binom.test( x, n, p = 0.5, alternative =
c("two.sided", "less", "greater"), conf.level = 0.95,
...)
## S3 method for class 'formula':
binom.test( x, n, p = 0.5,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, success=NULL, data.name, data, ...)
## S3 method for class 'numeric':
binom.test( x, n, p = 0.5,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, success=NULL, data.name, ...)
## S3 method for class 'character':
binom.test( x, n, p = 0.5,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, success=NULL, data.name, ...)
## S3 method for class 'logical':
binom.test( x, n, p = 0.5,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, success=NULL, data.name, ...)
## S3 method for class 'factor':
binom.test( x, n, p = 0.5, alternative
= c("two.sided", "less", "greater"), conf.level = 0.95,
success=NULL, data.name, ...)
n
may be a
data frame)htest
binom.test
from
the base
package to simplify its use when the raw
data are available, in which case an extended syntax for
binom.test
is provided.prop.test
,
binom.test
# Several ways to get a confidence interval for the proportion of Old Faithful
# eruptions lasting more than 3 minutes.
data(faithful)
binom.test(faithful$eruptions > 3)
binom.test(97, 272)
binom.test(c(97, 272-97))
faithful$long <- faithful$eruptions > 3
binom.test(faithful$long)
binom.test(~ long, faithful)
Run the code above in your browser using DataLab