Lably
Skip to content

Binomial test

Test of statistical significance

  • 6 min read
  • 5 chapters

Related on Lably

Through Statistical significance, Statistical hypothesis test and Binomial distribution

Usage

A binomial test is a statistical hypothesis test used to determine whether the proportion of successes in a sample differs from an expected proportion in a binomial distribution. It is useful for situations when there are two possible outcomes (e.g., success/failure, yes/no, heads/tails), i.e., where repeated experiments produce binary data. If one assumes an underlying probability π0 between 0 and 1, the null hypothesis is

H0:π=π0

For a sample of size n, we would expect nπ0 successes. The formula of the binomial distribution gives the probability of those n samples instead producing k successes:

Pr(X=k)=(nk)π0k(1−π0)n−k

Suppose that we want to test the alternative hypothesis

HA:π<π0

i.e., we suspect that the actual probability of success is lower than π0. Then the p-value of our experiment would be computed using a one-tailed test; specifically, we compute the probability of seeing an outcome as extreme as, or more extreme (i.e., less likely), than k (where k is defined as the number of successes in the n trials of our experiment):

p=∑i=0kPr(X=i)=∑i=0k(ni)π0i(1−π0)n−i

An analogous computation can be done if we're testing if π>π0 using the summation of the range from k to n instead.

Calculating a p-value for a two-tailed test is slightly more complicated, since a binomial distribution isn't symmetric if π0≠0.5. This means that we can't just double the p-value from the one-tailed test. Recall that we want to consider events that are as extreme, or more extreme, than the one we've seen, so we should consider the probability that we would see an event that is as, or less, likely than X=k. Let I={i:Pr(X=i)≤Pr(X=k)} denote all such events. Then the two-tailed p-value is calculated as,

p=∑i∈IPr(X=i)=∑i∈I(ni)π0i(1−π0)n−i

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Topics in mathematics