I have the result of a binomial test and it looks like this:
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
All I would like to know is how to extract just the p-value in R. I tried grep and pmatch but they appear to require a table or vector.
You only need to do:
binom.test(3,15)$p.value
Take a look at str(binom.test(3,15)) to see the other results from the binomial test. 3 and 15 are chosen arbitrarily so long as second number is larger than the first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With