# Likelihood ratio test computation help

I am trying to solve an problem from Rice's Mathematical Statistics and Data Analysis (Problem 9.41) and I got stuck doing some computation. Namely, let $X_i\sim\text{Bin}(n_i,p_i)$ for $i = 1,\dots,m$. I am supposed to devise a log-likelihood ratio test for the null hypothesis $H_0: p_1 =\cdots=p_m$, alternative being that not all are equal, and also to find its large sample distribution. I have computed the likelihood ratio to be

$$\Lambda = \frac{\prod_{i = 1}^m \hat p_i^{x_i}(1-\hat p_i)^{n_i-x_i}}{\hat p^{\sum_{i=1}^mx_i}(1-\hat p)^{\sum_{i=1}^m n_i-x_i}},$$ where $\hat p_i = x_i/n_i$ and $$\hat p= \frac{\sum_{i=1}^m x_i}{\sum_{i=1}^m n_i}.$$ However, when I try to compute $2\text{log} \Lambda$, I do not get anything remotely useful. I know that the large sample distribution is supposed to be $\chi^2(m-1)$, but I do not have any idea how to arrive at that conclusion.

• Welcome to our site! Thank you for showing us what you have done so far. Since this is a question from a textbook, please add the [self-study] tag & read its wiki. – Silverfish Aug 18 '16 at 10:03

I think you inversed the numerator with the denominator. If we want to test :$$H_0:\theta\in\Theta_0 \space vs\space H_1:\theta\in\Theta_0^c$$ where $\Theta$ is the parametric space, then: $$\Lambda(x)=\frac{\sup_{\Theta_0}L(\theta|x)}{\sup_{\Theta}L(\theta|x)}$$ Assuming that, $\Lambda$ should be written like this: $$\Lambda = \frac{\hat p^{\sum_{i=1}^mx_i}(1-\hat p)^{\sum_{i=1}^m n_i-x_i}}{\prod_{i = 1}^m \hat p_i^{x_i}(1-\hat p_i)^{n_i-x_i}}.$$
• That is true. However, in your case, the log likelihood is defined as $\lambda = -2\log\Lambda$ and the minus in front of the logarithm inverts the fraction. So I my case, where I want to compute the log likelihood, I think it does not matter. Or am I misunderstanding something? – letreetlneant Aug 18 '16 at 10:42
• @letreetlneant my bad, I didn't pay attention to $2 \log \Lambda$. – Toney Shields Aug 18 '16 at 10:50