Jannek93

2022-10-06

If ${\chi }^{2}$=0 for a dataset, are the frequencies of the values in the contingency table all the same?
Could I say that if the ${\chi }^{2}$ value of a dataset is 0, then the frequencies of the values of the cells in the contingency table are all the same? I have noticed that if I change the frequency of any of these values to be more than the other, that ${\chi }^{2}$ stops being 0.
$\begin{array}{lcc}\phantom{\rule{1em}{0ex}}& 1& 2\\ 1& 8& 8\\ 2& 8& 8\end{array}$
${\chi }^{2}=0$

Peutiedw

It depends on which chi-square test you're talking about. There are many. One frequently used chi-square test with contingency tables is a test of independence of rows and columns. Consider this table:
$\overline{)\begin{array}{rrr}2& 12& 14\\ 3& 18& 21\\ 5& 30& 35\end{array}}$
The numbers in the rightmost column to the right of the vertical line are the sums of the numbers in the rows to the left of the line; the numbers in the bottom row below the horizontal line are the sums of the numbers in the columns above the line; the 35 in the lower right is the sum of the two numbers above it, or equivalently, of the two numbers to its left, or, again equivalently, of the four numbers in the $2×2$ table above and to the left of the margins.
Take the number in each cell in the $2×2$ table to be the number of individuals in the sample that fall in that cell. The null hypothesis says the probability that an individual is in a particular row is independent of which column that individual is in and vice-versa. The observed numbers are totals in the sample rather than in the population, so you generally won't see perfect independence in the sample even if the null hypothesis is true. Since they're based on the sample rather than on the whole population, if we say the probability of being in the first row is $14/35=2/5$ (taking the numbers 14 and 21 from the right margin), that is an estimate. Similarly we can estimate the probability of being in the first column as $5/35=1/7$. The probability of being in the cell that is the upper left corner of the table, assuming that the null hypothesis of independence is true, is therefore estimated as $\left(14/35\right)×\left(5/35\right)=2/35$ Since the sample size is 35, the expected count in the first cell is therefore $\left(14/35\right)×\left(5/35\right)×35$ (and the obvious cancelation of 35 with 35 would happen even if all of the numbers had been different). Call this estimated expected value the expected count in the first cell.
In various chi-square tests (not all chi-square tests, but most chi-square tests that involve categorical data), the test statistic can be written as
$\sum \frac{\left(\text{observed}-\text{expected}{\right)}^{2}}{\text{expected}}.$
If you work out the chi-square test statistic for the table with the particular numbers I've put there, you'll find it's exactly 0, simply because I chose the numbers to make that happen.
But the four numbers are not equal.
On the other hand, if you're doing the simple chi-square test of the null hypothesis that says an ordinary six-sided die is "fair", then the "expected" counts will each be 1/6 of the sample size---thus all equal to each other---and the chi-square test statistic then won't be 0 unless all six counts in the sample are equal.