2.10 The Chi-Squared Test of
The Chi-Squared Test is used to find if two factors from the same sample are independent.
Some examples:
The
test examines the
difference between the observed and expected values
, where
is the observed
frequency,
is the expected
frequency
Ex 1 The following table shows the results from a
survey of 400 people. (these are the f0 values)
|
|
Regular Exercise |
No Exercise |
Sum |
|
Male |
112 |
104 |
216 |
|
Female |
96 |
88 |
184 |
|
Sum |
208 |
192 |
400 |
We are going to examine whether or not regular exercise and gender are independent
We have the f0 values, we need to calculate the fe values.
Consider a general 2 x 2 table
|
|
A1 |
A2 |
Sum |
|
B1 |
p |
q |
w |
|
B2 |
r |
s |
x |
|
Sum |
y |
z |
n |
So, for independence, ![]()
To change a probability to an expected value, multiply by n.
This means the expected value of
is ![]()
So our general table is going to look like
|
|
A1 |
A2 |
Sum |
|
B1 |
|
|
w |
|
B2 |
|
|
x |
|
Sum |
y |
z |
n |
This table tells us the general fe values
|
|
A1 |
A2 |
Sum |
|
B1 |
|
|
216 |
|
B2 |
|
|
184 |
|
Sum |
208 |
192 |
400 |
On the
|
f0 |
fe |
f0 - fe |
(f0 - fe)2 |
(f0 - fe)2/ fe |
|
112 |
112.3 |
|
|
|
|
104 |
103.7 |
|
|
|
|
96 |
95.7 |
|
|
|
|
88 |
88.3 |
|
|
|
|
|
|
|
|
0.00363 |
Since
is very small (more on
this later), then the two factors have been determined to be independent. This calculation is dependent on the degrees of freedom for our table.
, where r is the
number of rows and c is the number of
columns.
More on this next class.
p. 593# 1-4
Review of Probs: p. 490# 1-9, p. 492# 1-9, (p. 493# 1-9)