406 CHAPTER 6 Inferential Statistics
given by
χ^2 =
∑(ni−E(ni))^2
E(ni)
,
where the sum is over each of thekpossible outcomes (in this case,k=
6), whereni is the number of times we observe outcomei, and where
E(ni) is the expected number of times we would observe the outcome
under the null hypothesis. Thus, in the present case, we would have
E(ni) = 200/ 6 , i= 1, 2 , ...,6, andn 1 = 33, n 2 = 40, ..., n 6 = 24. Of
course, just because we have denoted this sum byχ^2 doesn’t already
guarantee that it has a χ^2 distribution. Checking that it really does
would again take us into much deeper waters. However, if we consider
the simplest of all cases, namely when there are only two categories,
then we can argue that the distribution of the above statistic really is
approximatelyχ^2 (and with one degree of freedom).
When there are only two categories, then of course we’re really doing
a binomial experiment. Assume, then, that we make n measure-
ments (or “trials”) and that the probability of observing a outcome
falling into category 1 is p. This would imply that ifn 1 is the num-
ber of observations in category 1, then E(n 1 ) = np. Likewise, the if
n 2 is the number of observations in category 2, thenn 2 =n−n 1 and
E(n 2 ) =n(1−p).
In this case, our sum takes on the appearance
χ^2 =(n^1 −E(n^1 ))
2
E(n 1 ) +
(n 2 −E(n 2 ))^2
E(n 2 ) =
(n 1 −np)^2
np +
(n 2 −n(1−p))^2
n(1−p)
=
(n 1 −np)^2
np +
(n−n 1 −n(1−p))^2
n(1−p)
= (n^1 −np)
2
np +
(n 1 −np)^2
n(1−p)
= (n^1 −np)
2
np(1−p)
However, we may regardn 1 as the observed value of a binomial random
variableN 1 with meannpand standard deviation
»
np(1−p); further-
more, ifnis large enough, thenN 1 is approximately normal. Therefore