# What is the maximum for Pearson's chi square statistic?

I actually know that the answer is $N(k-1)$ (where $k$ is the minimum between number of rows and number of columns).

However, I can not seem to find a simple proof for why the statistic is bounded by this. Any suggestions (or references?)

-
For some intuition about this, consider the square case (k rows and columns), with $N=nk$. Then the maximal Chi Square occurs when all the marginal total are equal (in this case $n$), and the values in the table are n along the diagonal and 0 for the off diagonal, so that you have perfect association between the row and column variables. Then the Chi Square statistic is $$\sum (O-E)^2/E = k\cdot(n-n/k)^2/(n/k)+k\cdot(k-1)\cdot(0-n/k)^2/(n/k)$$ where the first part represents the sum of the k diagonal elements and the second part is the sum of the off diagonal elements. You can show that this sum is $nk(k-1)=N(k-1)$. Similar reasoning extends to the case where the number of rows and columns are not the same.
One might add that for different number of rows and columns, $k$ then must be the minimum of these two. –  caracal Jul 19 '11 at 8:17