R 如何从二项测试中提取p值

R 如何从二项测试中提取p值,r,extraction,p-value,R,Extraction,P Value,我有一个二项测试的结果,它看起来像这样: data: x and n number of successes = 0, number of trials = 7, p-value = 0.01563 alternative hypothesis: true probability of success is not equal to 0.5 95 percent confidence interval: 0.0000000 0.4096164 sample estimates: probab

我有一个二项测试的结果,它看起来像这样:

data:  x and n
number of successes = 0, number of trials = 7, p-value = 0.01563
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
 0.0000000 0.4096164
sample estimates:
probability of success 
                     0 
我只想知道如何提取R中的p值。我尝试了grep和pmatch,但它们似乎需要一个表或向量

您只需执行以下操作:

binom.test(3,15)$p.value

查看
str(二项测试(3,15))
以查看二项测试的其他结果。只要第二个数字大于第一个数字,就可以任意选择3和15。

您使用什么代码生成此输出?@mtoto正如@rawr所识别的,输出是由
binom.test(x,n)
生成的。可以使用
binom.test(x,n)$p.value
从该输出访问p值。