InfluentialPoints.com
Biology, images, analysis, design...
Use/Abuse Principles How To Related
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)

Search this site

 

 

Exact binomial test using R

Exact Binomial Test


Gives something like this:

Exact binomial test data: c(1003, 1014) number of successes = 1003, number of trials = 2017, p-value = 0.4119 alternative hypothesis: true probability of success is less than 0.5 95 percent confidence interval: 0.0000000 0.5158274 sample estimates: probability of success 0.4972732

 

Sign Test


R does not have a separate sign test, but it can be carried out by first eliminating ties and then using the exact binomial test.

Gives something like this:

Exact binomial test data: c(7, 1) number of successes = 7, number of trials = 8, p-value = 0.03516 alternative hypothesis: true probability of success is greater than 0.5 95 percent confidence interval: 0.5293206 1.0000000 sample estimates: probability of success 0.875

 

McNemar's test


Gives something like this:

McNemar's Chi-squared test with continuity correction data: tab1 McNemar's chi-squared = 34.3, df = 1, p-value = 4.724e-09

 

Cox & Stuart test for trend

Gives something like this:

Exact binomial test data: c(4, 0) number of successes = 4, number of trials = 4, p-value = 0.125 alternative hypothesis: true probability of success is not equal to 0.5 95 percent confidence interval: 0.3976354 1.0000000 sample estimates: probability of success 1

 

There is as yet no provision in the package epitools in R for estimating the confidence interval to the difference between paired proportions.