Lab
3: 2x2 Contingency table
For
the third lab the class filled in a 2x2 contingency table according to their
morning habits: coffee drinker (Y/N) and breakfast eater (Y/N). The table and class data are given below:
Coffee Yes No Total Breakfast Yes 22 26 48 No 12 3 15 Total 34 29 63
The
class was asked to perform a test of independence on the data using Cochrane’s
correction for continuity.
H0:
Whether someone drinks coffee is independent of whether they eat breakfast
H0: pij = pi.*p.j
for i=1,…,r, j=1,…,c
Ha:
Coffee drinking and breakfast eating are not independent
Ha: pij ≠ pi.*p.j
for at least one i=1,…,r,
j=1,…,c
df = 1*1 = 1
χ21,.05 = 3.841
The
smallest expected count is:
15*29/63 = 6.905,
which is greater than f=3
|3-6.905| = 3.905,
therefore D=3.5
χ2c
= 633*3.52/(34*29*48*15) = 4.305
4.305>3.841,
therefore reject H0.
0.025 < P(χ21>4.305) < 0.05
Breakfast eating
is not independent of coffee drinking.