# 5 Binomial Test

## 5.1 Binomial Test

The binomial test is used to look for evidence that the proportion of a Binomial distributed random variable may differ from a hypothesized (or previously observed) value.

### 5.1.1 Test Statistic

The test statistic for a binomial test is the observed frequency of experimental subjects that exhibit the trait of interest.

### 5.1.2 Definitions

Let $$X$$ be a random variable following a binomial distribution with parameters $$n$$ and $$\pi$$. Let $$x$$ be the observed frequency of experimental subjects exhibiting the trait of interest.

### 5.1.3 Hypotheses

The hypotheses for the Binomial test may take the following forms:

For a two-sided test:

\begin{aligned} H_0: \pi = \pi_0 \\ H_a: \pi \neq \pi_0 \end{aligned}

For a one-sided test:

\begin{aligned} H_0: \pi < \pi_0 \\ H_a: \pi \geq \pi_0 \end{aligned}

or

\begin{aligned} H_0: \pi > \pi_0 \\ H_a: \pi \leq \pi_0 \end{aligned}

### 5.1.4 Decision Rule

The decision to reject the null hypothesis is made when the observed value of $$x$$ lies in the critical region that suggests the probability of that observation is low. We define the critical region as the upper bound we are willing to accept for $$\alpha$$, the Type I Error.

In a two-sided test, the upper bound is shared equally in both tails. Due to the discrete nature of the distribution, the total probability in the tails may not equal $$\alpha$$. The figures below depict examples of rejection regions for selected values of the Binomial distribution parameters. The decision rule is:

Reject $$H_0$$ if $$x < Binomial(\alpha/2, n, \pi_0)$$ or $$x > Binomial(1 - \alpha/2, n, \pi_0)$$ Figure 5.1: The examples displayed use $$n = 20$$. For the top, middle, and bottom examples, $$\pi$$ is set at 0.3, 0.5, and 0.75, respectively. Notice that in some cases, the rejection regions for $$\alpha = 0.10$$ and $$\alpha = 0.05$$ are identical.

In the one-sided test, $$\alpha$$ is placed in only one tail. The figures below depict examples of rejection regions for selected values of the Binomial distribution parameters. In each case, $$\alpha$$ is the area in the tail of the figure. It follows, then, that the decision rule for a lower tailed test is:

Reject $$H_0$$ when $$x \leq Binomial(\alpha, n, \pi_0)$$

For an upper tailed test, the decision rule is:

Reject $$H_0$$ when $$x \geq Binomial(1 - \alpha, n, \pi_0)$$ Figure 5.2: The examples displayed use $$n = 20$$. For the top, middle, and bottom examples, $$\pi$$ is set at 0.3, 0.5, and 0.75, respectively.

### 5.1.5 Power

The derivations below make use of the following symbols:

• $$x$$: The observed frequency of experimental units exhibiting the trait of interest.
• $$n$$: The total number of experimental units.
• $$\pi_0$$: The proportion of the population that exhibits the trait of interest under the null hypothesis.
• $$\pi_a$$: The proportion of the population that exhibits the trait of interest under the alternative hypothesis.
• $$\alpha$$: The significance level.
• $$\gamma(\pi)$$: The power of the test for the parameter $$\pi$$.
• $$Binomial(\alpha, n, \pi)$$: A quantile of the Binomial distribution with a probability $$\alpha$$, and parameters $$n$$ and $$\pi$$.
• $$C$$: The critical region.

Two Sided Test

\begin{aligned} \gamma(\pi_a) &= P_{\pi_a}(x \in C) \\ &= P_{\pi_a}(Binomial(\alpha/2, n, \pi_0) \leq Binomial(\alpha / 2, n, \pi_a)) + \\ & \ \ \ \ \ \ \ P_{\pi_a}(Binomial(1 - \alpha / 2, n, \pi_0) \geq Binomial(1 - \alpha / 2, n, \pi_a)) \end{aligned}

Left Sided Test

\begin{aligned} \gamma(\pi_a) &= P_{\pi_a}(x \in C) \\ &= P_{\pi_a}(Binomial(\alpha, n, \pi_0) \leq Binomial(\alpha, n, \pi_a)) \end{aligned}

Right Sided Test

\begin{aligned} \gamma(\pi_a) &= P_{\pi_a}(x \in C) \\ &= P_{\pi_a}(Binomial(1 - \alpha, n, \pi_0) \geq Binomial(1 - \alpha, n, \pi_a)) \end{aligned}

Since the Binomial distribution is discrete, the power curve has the interesting characteristic of not being monotonic. It is sometimes described as having a “sawtooth” appearance. This behavior means that a larger sample size is not always preferred. For example, in the following figure, a sample size of 10 has better power than a sample size of 12. Figure 5.3: Power for a Binomial test with $$\pi_0 = .15$$ and $$\pi_a = 0.25$$