R语言 进行二项式测试 – binom.test()方法

R语言 进行二项式测试 – binom.test()方法

binom.test() 方法的帮助下,我们可以在R编程中对二项分布的一些假设进行二项检验。

语法: binom.test(x, n, p-value)

返回: 返回二项式检验的值。

例1 :

# Using binom.test() method
  
gfg <- binom.test(58, 100)
  
print(gfg)
R

输出

Exact binomial test

data:  58 and 100
number of successes = 58, number of trials = 100, p-value = 0.1332
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
 0.4771192 0.6780145
sample estimates:
probability of success 
                  0.58 
R

例2 :

# Using binom.test() method
  
gfg <- binom.test(1, 36, 0.6)
  
print(gfg)
R

输出

Exact binomial test

data:  1 and 36
number of successes = 1, number of trials = 36, p-value = 2.597e-13
alternative hypothesis: true probability of success is not equal to 0.6
95 percent confidence interval:
 0.0007030252 0.1452892647
sample estimates:
probability of success 
            0.02777778 
R

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程

登录

注册