Binomial Rejection Region

hypothesis testingstatistical-inferencestatistics

When $X_1,\ldots,X_n \sim N(\theta, 1)$ with $H_0:\theta = \theta_0$ versus $H_0:\theta \neq \theta_0$, the the likelihood ratio test is given by

\begin{align}
\lambda({x}) &= \frac{(2\pi)^{-n/2}\exp\left\{ \frac{-\sum_i^n(x_i – \theta_0)^2}{2} \right\}}{(2\pi)^{-n/2}\exp\left\{ \frac{-\sum_i^n(x_i – \bar{x})^2}{2} \right\}}
\\&= \exp\left\{\frac{-n(\bar{x} -\theta_0)^2}{2}\right\}
\end{align}

It follows that the rejection region $\{x\hspace{0.1cm}:\lambda(x)\hspace{0.1cm}\leq c\}$ is

\begin{align}
\left\{x\hspace{0.1cm}: |\bar x – \theta_0|\geq \sqrt{\frac{-2\log c}{n}}\right\}\tag{1}
\end{align}


However, when we have a single trial $X$ with $X\sim \text{Binomial}(n, p)$ and with $H_0:p = 0.5$ versus $H_0:p \neq 0.5$, I'm having trouble deriving the a similar result as in $(1)$. So to begin,

\begin{align}
\lambda({x}) &= \frac{{n \choose x}0.5^n}{{n \choose x}\hat{p}^x(1-\hat{p})^{n-x}} \\&= \frac{0.5^n}{(\frac{x}{n})^x(1-\frac{x}{n})^{n-x}} \hspace{2cm} \text{ since $\hat{p} = \frac{x}{n}$} \hspace{1cm}\text{(MLE for $p$)}
\end{align}

Now, we reject whenever $\lambda(x) < c$ where $c$ is some constant.

\begin{align}
\frac{0.5^n}{\left(\frac{x}{n}\right)^x\left(1-\frac{x}{n}\right)^{n-x}} < c
\end{align}

However, this is where I get stuck. I'm not sure how to proceed from here? I want to end up with something similar to $(1)$ telling me when to reject $H_0$.

Best Answer

Suppose you have $n = 10$ trials with $x$ successes and you want to test $H_0: p = 1/2$ vs $H_a: p \ne 1/2$ at (somewhere near) the 5% level. I say 'somewhere near' because the binomial distribution is discrete, so it is not possible in general to achieve an exact significance level.

Under $H_0,$ (that, is assuming the null hypothesis to be true) the number of successes $X \sim \mathsf{Binom}(n=10,\, p = 1/2).$

In your last inequality the fraction on the left-hand side is smallest when $\hat p = X/n$ is far from $1/2.$ So you need to reject when the number of successes $X$ is far from $n/2.$

n = 10; x = 1:(n-1)
p = x/n; frac=.5^n/(p^x*(1-p)^(n-x))
plot(x, frac, pch=19)

enter image description here

Accordingly, we might reject for $X = 0,1,9,10,$ the four values most removed from $10/2 = 5.$ A calculation using the binomial PDF gives $P(X \le 2) = P(X \ge 9) = 0.0214.$ So that rejection rule leads to a test at about the 2% level.

If we try to reject for $X = 0,1,2,8,9,10,$ then the significance level escalates to $0.109,$ so you would be testing at about the 11% level. If you want to keep the significance level below 5%, then you'll have to use the rule to reject for $X = 0,1,9,10.$

Here is a graph of the relevant binomial PDF:

enter image description here

Computations using R statistical software:

rej = c(0,1,9,10);  sum(dbinom(rej, 10, .5))
[1] 0.02148438
rej = c(0,1,2,8,9,10);  sum(dbinom(rej, 10, .5))
[1] 0.109375

Note: For larger values of $n,$ one might approximate binomial probabilities using a normal distribution, but $n = 10$ is a bit too small for completely satisfactory normal approximations.

Related Question