# Understanding the chi-squared test of independence

I'm trying to understand the chi-squared test for independence and in the textbook I'm looking at (Casella and Berger) it's developed as part of an exercise. In the exercise you are given two binomial populations $(n_1,p_1)$ and $(n_2,p_2)$ and the null hypothesis that $p_1=p_2$.

The exercise is to show that a test can be based on the statistic: $$T = \frac{(P_1-P_2)^2}{\big(\frac 1 {n_1} + \frac 1 {n_2}\big)(P(1-P))}$$

Where the capital $P$s signify the MLEs (essentially the successes divided by the number of trials).

Any answer I've found basically uses the CLT and limiting behaviour to show that the square root of the above statistic approaches a normal distribution and therefore $T$ is distributed as chi-squared.

While I follow that, my interpretation of the question is that T could be used as a test statistic before the limiting behaviour is looked at, so while it wouldn't be chi squared distributed unless the sample size was large, it would still be a valid test statistic for checking if the probabilities were equal in 2 binomial populations.

To show this I tried to do an LRT where I found the maximum likelihood when when $p_1=p_2$ and divided by the maximum likelihood over the entire parameter space (when $p_1$ is not necessarily the same as $p_2$).

I got nowhere with this and was just wondering if this was even possible or if I'm misinterpreting the question and the above T statistic is solely derivable using limiting behaviour.

• The chi-squared test is a score test, not a LRT. – gung May 1 '18 at 1:23