Binomial Distribution: Likelihood Ratio Test for Equality of Several Proportions $\newcommand{\szdp}[1]{\!\left(#1\right)}
\newcommand{\szdb}[1]{\!\left[#1\right]}$
Problem Statement: A survey of voter sentiment was conducted in four midcity
political wards to compare the fraction of voters favoring candidate $A.$
Random samples of $200$ voters were polled in each of the four wards. The numbers of voters favoring $A$ in the four samples can be regarded as four independent binomial random variables. Construct a likelihood ratio test of the hypothesis that the
fractions of voters favoring candidate $A$ are the same in all four wards.
Use $\alpha=0.05.$
Note 1: This is essentially Exercise 10.88 in Mathematical Statistics with Applications, 5th Ed., by Wackerly, Mendenhall, and Sheaffer.
Note 2: I have looked at several threads asking the same question. This thread has no viable answer. This thread has a solution done mostly in R and is not a theoretical derivation of the needed result. This thread works out exactly zero details: and as you'll see, I'm definitely in the weeds on this one.
Note 3: This is cross-posted here.
My Work So Far: Let $p_i$ be the proportion of voters favoring $A$ in Ward $i.$ So the
null hypothesis is that $p_1=p_2=p_3=p_4,$ while the alternative hypothesis
is that at least one proportion is different from the others. We have
$f$ as the
underlying
distribution:
$$f(y_i)=\binom{n}{y_i}p_i^{y_i}(1-p_i)^{n-{y_i}}.$$
It follows that the likelihood function is
$$L(p_1,p_2,p_3,p_4)
=\prod_{i=1}^4\szdb{\binom{n}{y_i}p_i^{y_i}(1-p_i)^{n-y_i}}.$$
Then we construct $L\big(\hat\Omega_0\big)$ and $L\big(\hat\Omega\big).$ Note
that under the null hypothesis, we will set $p_1=p_2=p_3=p_4=p.$ Hence,
$$L\big(\hat\Omega_0\big)
=\prod_{i=1}^4\szdb{\binom{n}{y_i}p^{y_i}(1-p)^{n-y_i}}.$$
The one remaining parameter $p$ we will replace with its MLE, which we can
confidently say is $\big(\sum y_i\big)/(4n).$ Hence
\begin{align*}
L\big(\hat\Omega_0\big)
&=\prod_{i=1}^4\szdb{\binom{n}{y_i}\szdp{\frac{\sum 
y_i}{4n}}^{\!\!y_i}\szdp{1-\frac{\sum y_i}{4n}}^{\!\!n-y_i}}\\
&=\frac{1}{(4n)^n}\prod_{i=1}^4\szdb{\binom{n}{y_i}\szdp{\sum 
y_i}^{\!y_i}\szdp{4n-\sum y_i}^{\!n-y_i}}.
\end{align*}
Next, we turn our attention to $L\big(\hat\Omega\big):$
\begin{align*}
L\big(\hat\Omega\big)
&=\prod_{i=1}^4\szdb{\binom{n}{y_i}\szdp{\frac{y_i}{n}}^{\!y_i}
        \szdp{1-\frac{y_i}{n}}^{\!n-y_i}}\\
&=\prod_{i=1}^4\szdb{\binom{n}{y_i}\szdp{\frac{y_i}{n}}^{\!y_i}
        \szdp{\frac{n-y_i}{n}}^{\!n-y_i}}\\
&=\frac{1}{n^{4n}}\prod_{i=1}^4\szdb{\binom{n}{y_i}y_i^{y_i}
        \,\szdp{n-y_i}^{n-y_i}}.
\end{align*}
Next we form the likelihood ratio:
\begin{align*}
\lambda
&=\frac{L\big(\hat\Omega_0\big)}{L\big(\hat\Omega\big)}\\
&=\frac{\displaystyle 
        \frac{1}{(4n)^n}\prod_{i=1}^4\szdb{\binom{n}{y_i}
            \szdp{\sum y_i}^{\!y_i}\szdp{4n-\sum y_i}^{\!n-y_i}}}
       {\displaystyle 
        \frac{1}{n^{4n}}\prod_{i=1}^4\szdb{\binom{n}{y_i}y_i^{y_i}
            \,\szdp{n-y_i}^{n-y_i}}}\\
&=\frac{n^{4n}}{4^n\,n^n}\cdot
 \prod_{i=1}^4\szdb{\szdp{\frac{\sum y_j}{y_i}}^{\!y_i}\,
                       \szdp{\frac{4n-\sum y_j}{n-y_i}}^{\!n-y_i}}\\
&=\szdp{\frac{n^3}{4}}^{\!\!n}\cdot
 \prod_{i=1}^4\szdb{\szdp{\frac{\sum y_j}{y_i}}^{\!y_i}\,
                       \szdp{\frac{4n-\sum y_j}{n-y_i}}^{\!n-y_i}}.
\end{align*}
My Questions:

*

*This looks wrong to me, because I'm told (and it totally makes sense) that $0\le\lambda\le 1,$ whereas everything in sight is greater than $1.$

*Supposing this expression can be salvaged, what are the next steps? Should I take logs and try to simplify somehow?

*I'm expecting to be able to obtain a test something along the lines of
$$\frac{(1/(4n))\sum_{j=1}^ny_j-\sum_{j=1}^n(y_j/n)}{\displaystyle\sqrt{\sum_{j=1}^4\dfrac{(y_j/n)(1-y_j/n)}{n}}},$$
although this test doesn't strike me as sensitive enough. We could have $y_1/n$ much too low, and $y_4/n$ much too high, and this test could still mark them down as equal because they "average out" to the right thing. What's the right generalization to the standard difference of proportions test?


Comment continued. A reasonable approximation to
the likelihood ratio test is a chi-squared test of homogeneity for a contingency table. There are
two essentially equivalent implementations of
such a test in R. Using the data from w-M-S, 6e, Exercise 10.94, I show results from each. [Counts are large enough that results should be similar to LR test.]
Data. Wards are rows, Favor and Not are columns.
TBL = cbind(c(76,53,59,48), 
            c(123,147,141,153))
TBL
     [,1] [,2]
[1,]   76  123
[2,]   53  147
[3,]   59  141
[4,]   48  153

In R, the procedure prop.test uses an approximately chi-squared statistic to compare the four proportions in favor for the four rows of TBL. The null hypothesis that true proportions are the same in all four wards is decisively rejected at the 5% level (P-value about 1%).
 prop.test(TBL)

    4-sample test for equality of proportions 
    without continuity correction

data:  TBL
X-squared = 11.145, df = 3, p-value = 0.01097
alternative hypothesis: two.sided
sample estimates:
   prop 1    prop 2    prop 3    prop 4 
0.3819095 0.2650000 0.2950000 0.2388060 

Pearson's chi-squared test of heterogeneity gives the same chi-squared statistic and P-value.
    chisq.test(TBL)

            Pearson's Chi-squared test

    data:  TBL
    X-squared = 11.145, df = 3, p-value = 0.01097

The proportions in favor seems about the same in wards 2, 3, and 4. An ad hoc test finds no significant difference among them.
chisq.test(TBL[2:4,])

        Pearson's Chi-squared test

data:  TBL[2:4, ]
X-squared = 1.6228, df = 2, p-value = 0.4442

By contrast, an ad hoc 'chisq.test` of Ward 1 against
the other three wards (without Yates' correction because of large counts) finds a highly significant difference.
chisq.test(TBL2, cor=F)

       Pearson's Chi-squared test

data:  TBL2
X-squared = 9.6204, df = 1, p-value = 0.001924

Fisher's exact test (ad hoc) also finds a significant difference at about the 1% level.
fisher.test(TBL)

        Fisher's Exact Test 
        for Count Data

data:  TBL
p-value = 0.01226
alternative hypothesis: two.sided

