2
$\begingroup$

I have an $r\times c$ contingency table. The chi-square statistic for the table is equal to $\chi^2 = \sum_{i=1}^{rc} (O_i - E_i)^2 / E_i$, where $O_{i}$ are the observed and expected counts for cell $i$ respectively. Let $n$ be the total number of counts. Then the variance of $\chi^2$ is given by $2 \times (r-1) \times (c-1)$, where $(r-1) \times (c-1)$ is the number of degrees of freedom. My question is the following – why does the variance not depend only on the $df$ and not on the total number of counts, $n$? It would seem to me that if $n$ is smaller there would be greater variability in the observed counts. If $n$ is extremely large, the observed counts would be very precise, leading to a more precise $\chi^2$ statistic.

$\endgroup$
8
  • 2
    $\begingroup$ You need to pay attention to the information that went into computing the expected values $E_i.$ These issues are extensively discussed in other threads. Use keywords like "degrees of freedom" to search our site. $\endgroup$
    – whuber
    Jul 10, 2019 at 16:09
  • $\begingroup$ Sure the expected values $E_{i} = np_{i}$ and so depend on $n$. But the issue remains that if $n$ is larger both $O_{i}$ and $E_{i}$ are more precise and so $Var(\chi^2)$ should still intuitively depend on $n$. $\endgroup$
    – treemake
    Jul 10, 2019 at 16:33
  • 1
    $\begingroup$ Then it's important to modify your intuition: searching our site can help with that. Your premise is questionable, though: the statistic already accounts for the precision in the $O_i$ in dividing by $E_i,$ which is a (close) proxy for their variance. $\endgroup$
    – whuber
    Jul 10, 2019 at 16:46
  • 2
    $\begingroup$ "$rc$" is a misleading choice for the d.f in a chi-squared on a contingency table, as $r$ and $c$ conventionally stand for the number of rows and columns of the contingency table respectively, but then it is not the case that the df are $r \times c$ (almost never; it's actually somewhat tricky to come up with a realistic situation where you have that; if you are in such a situation, it might be worth mentioning it). Most typically the d.f. parameter in a test of independence is $(r-1)\times (c-1)$. . $\endgroup$
    – Glen_b
    Jul 11, 2019 at 2:01
  • 1
    $\begingroup$ @whuber Thanks, I see what you mean. It is the division by $E_i$ which normalizes the distribution. I suppose a simple analogy would be the z-statistic (for a Normal variate) which has fixed variance of 1 regardless of sample size, due to the standard error (of the Normal variate) in its denominator. $\endgroup$
    – treemake
    Jul 14, 2019 at 15:17

1 Answer 1

3
$\begingroup$

Let's start with a different question, and then argue by analogy:

Suppose $X$ has a binomial distribution with parameters $n$ and $p$, so with mean $np$, and variance $np(1-p)$ and fourth moment about the mean of $3n^2p^2(1-p)^2-6np^2(1-p)^2-np(1-p)$.

Then consider $Y = \frac{(X-\mathbb E[X])^2}{\mathbb E[X]}$. You can show that $Y$ has mean $\frac{np(1-p)}{np}=1-p$ which does not depend on $n$ and $Y$ has variance $2(1-p)^2 -\frac{6}{n}(1-p)^2+\frac{1}{n}\frac{1-p}{p}$; as $n$ increases, the variance of $Y$ tends towards $2(1-p)^2$, which also does not depend on $n$.

Now coming back to your question, one ${(O_i-E_i)^2/E_i}$ is rather similar to the binomial case albeit affected by the row and column constraints, and similarly $\sum_{i=1}^{rc} (O_{i} – E_{i})^{2} / E_{i}$ is similar to the sum of an constant number of these though with some small covariances. So it is reasonable that, as $n$ increases, the variance of your $\chi^2$ heads towards a finite positive value which does not depend substantially on $n$.

In simpler form, ${(X-\mathbb E[X])^2}$ has a mean which is $O(n)$ and a variance which is $O(n^2)$ so $Y$ has a mean and a variance which are both $O(1)$. Similarly $(O_i-E_i)^2$ has a mean which is $O(n)$ and a variance which is $O(n^2)$ so ${(O_i-E_i)^2/E_i}$ and $\sum_{i=1}^{rc} (O_{i} – E_{i})^{2} / E_{i}$ have means and variances which are $O(1)$.

It is the division by $\mathbb E[X]$ and by $E_i$ which largely removes the effect of $n$ both on both the means and the variances, at least when $n$ is large.

$\endgroup$

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.