Consider a 2x2 contingency table with X having two categories {men,women} and Y having categories {yes,no}. For each category of X the observations was fixed (so the rows had fixed totals).The observations for each row are independent. Suppose that there where a total of $n_1$ observations for category {women} and that $f_1$ observations was 'yes'.A total of $n_2$ observations for category {men} with $f_2$ observations on 'yes'.

So therefore I have two independent random variables which has a binomial distribution say $Z_1 \sim Bin(n_1,\pi_1) $ , $Z_2 \sim Bin(n_2,\pi_2) $

I want to make a test using the Pearson statistic $X^2$. I want to test $H_0= \pi_1 = \pi_2 = \pi$ , so therefore I need to estimate the parameter $\pi$ for example by maximizing the likelihood equation. But my question is how should i set up this equation?

  • Should the ML equation be the product $L_1(\pi)= Pr(Z_1 = f_1 ) Pr(Z_2 = f_2 )$


  • Should i treat all observations as 'one' , that is , don't care about gender. So we will actually have a random variable $Z_3 \sim bin (n_1 + n_2, \pi)$ and the likelihood equation will be $L_2(\pi) = Pr(Z_3 = f_1 + f_2)$
  • $\begingroup$ Sorry guys the two alternatives are equivalent in this case . Should I close this question ? $\endgroup$ – Danny Jan 30 '16 at 20:04
  • 1
    $\begingroup$ You can post an answer yourself explaining how you answered your question :) $\endgroup$ – JohnK Jan 30 '16 at 20:53
  • $\begingroup$ Yes, better to answer the question yourself than close it or delete it - a good answer will help others in a similar situation. $\endgroup$ – Glen_b -Reinstate Monica Jan 31 '16 at 0:45

The Maximum likelihood equation for the first alternative is:

\begin{equation} L_1(\theta)= Pr(Z_1=f_1)\cdot Pr(Z_2 =f_2) = \binom{n_1}{f_1}\pi^{f_1}(1-\pi)^{n_1-f_1}\cdot \binom{n_2}{f_f}\pi^{f_2}(1-\pi)^{n_2-f_2} \propto \pi^{f_1+f_2}(1-\pi)^{n_1+n_2-(f_1+f_2)} \end{equation}

Since under the null hypothesis men and women have the same "opinion" ($\pi_1 = \pi_2 = \pi$), we can treat everything as 'one sample' as opposed to two samples (one sample for men, and one for women). Setting up this likelihood equation we get:

\begin{equation} L_2(\theta)=Pr(Z_3=f_1+f_2) = \binom{n_1+n_2}{f_1+f_2}\pi^{f_1+f_2}(1-\pi)^{n_1 +n_2 -(f_1 +f_2)}\propto \pi^{f_1+f2}(1-\pi)^{n_1 +n_2 -(f_1 +f_2)} \end{equation}

Inference about $\pi$ will be the same in both cases.(The ML equations are the equivalent.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.