第一次输入,
x
,应为长度1与成功次数的整数,或长度2与成功和失败次数的整数,如下所示。
请参见
?binom.test
了解更多详细信息。
binom.test(c(round(0.555*10), round((1-0.555)*10)))
Exact binomial test
data: c(round(0.555 * 10), round((1 - 0.555) * 10))
number of successes = 6, number of trials = 10, p-value = 0.7539
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
0.2623781 0.8784477
sample estimates:
probability of success
0.6
从文档中:
Usage
binom.test(x, n, p = 0.5,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95)
Arguments
x
number of successes, or a vector of length 2 giving the numbers of successes and failures, respectively.
n
number of trials; ignored if x has length 2.