SECTION 6.6 χ^2 and Goodness of Fit 411
on the viewers!
6.6.1 χ^2 tests of independence; two-way tables
Students who have attended my classes will probably have heard me
make a number of rather cavalier—sometimes even reckless—statements.
One that I’ve often made, despite having only anecdotal evidence, is
that among students having been exposed to both algebra and geome-
try, girls prefer algebra and boys prefer algebra. Now suppose that we
go out and put this to a test, taking a survey of 300 students which
results in the followingtwo-way contingency table^32 :
Gender
Male Female Totals
Subject Preference
Prefers Algebra
Prefers Geometry
69
78
86
67
155
145
Totals 147 153 300
Inherent in the above table are two categorical random variables
X=gender andY= subject preference. We’re trying to assess the inde-
pendence of the two variables, which would form our null hypothesis,
versus the alternative that there is a gender dependency on the subject
preference.
In order to make the above more precise, assume, for the sake of
argument that we knew the exact distributions ofX andY, say that
P(X= male) =p, and P(Y prefers algebra) =q.
IfXandY are really independent, then we have equations such as
P(X= male andY prefers algebra) = P(X= male)·P(Y prefers algebra)
= pq.
Given this, we would expect that among the 300 students sampled,
roughly 300pqwould be males and prefer algebra. Given that the actual
(^32) These numbers are hypothetical—I just made them up!