Test of Independence
Contingency Tables
Test of Independence: Test the null hypothesis that the row variable and the column variable in a contingency table are not related (the null hypothesis is the statement that the row and column variables are independent/not related/not associated). Null Hypothesis: Ho: Variable A is independent from variable B Variable A and variable B are independent Variable A is not related to variable B Variable A and variable B are not related
Contingency Tables
An r c contingency table shows the observed frequencies for two variables and arranged in r rows and c columns. The intersection of a row and column is called a cell.
2 x 5 contingency table
Contingency Tables
Favorite way to eat ice cream
Gender Cup Cone Sundae Sandwich Other
Male Female
600 410
288 340
204 180
24 20
84 50
The observed frequencies in the interior of a contingency table are called joint frequencies.
Contingency Tables
Favorite way to eat ice cream
Gender Male Cup 600 Cone 288 Sundae Sandwich 204 24 Other 84 Row Total 1200
410 1010
340 628
180 384
20 44
50 134
1000 n = 2200
The sum of each row and column in a contingency table are called marginal frequencies.
Contingency Tables
Favorite way to eat ice cream
Gender Male Female Column Total Cup 600 410 1010 Cone 288 340 628 Sundae Sandwich 204 180 384 24 20 44 Other 84 50 134 Row Total 1200 1000 n = 2200
Male Cup: Male Cone: Male Sundae: Male Sandwich : Male Other:
(1200 1010) 2200 = 550.91 = 551 (1200 628) 2200 = 342.55 = 343 (1200 384) 2200 = 209.45 = 209 (1200 44) 2200 = 24 (1200 134) 2200 = 73.09 = 73
Contingency Tables
Favorite way to eat ice cream
Gender Male Female Column Total Cup 600 410 1010 Cone 288 340 628 Sundae Sandwich 204 180 384 24 20 44 Other 84 50 134 Row Total 1200 1000 n = 2200
Female Cup: Female Cone: Female Sundae: Female Sandwich: Female Other:
(1000 1010) 2200 = 459.09 = 459 (1000 628) 2200 = 285.45 = 285 (1000 384) 2200 = 174.55 = 175 (1000 44) 2200 = 20 (1000 134) 2200 = 60.91 = 61
Contingency Tables
Gender Favorite Male Cup Male Cone Male Sundae Male Sandwich Male Other Female Cup Female Cone Female Sundae Female Sandwich Female Other Observed Frequency (fo) 600 288 204 24 84 410 340 180 20 50 Expected Frequency (fe) 551 343 209 24 73 459 285 175 20 61
Gender Favorite Male Cup Male Cone Male Sundae Male Sandwich Male Other Female Cup Female Cone Female Sundae Female Sandwich
Female Other
(fe) (fo fe) (fo fe)2 fe 551 49 (49)2 551 = 4.2575 343 55 (-55)2 343 = 8.8192 209 5 (-5)2 209 = 0.1196 24 0 (0)2 24 = 0.0000 73 11 (11)2 73 = 1.6575 459 49 (-49)2 459 = 5.2309 285 55 (55)2 285 = 10.6140 175 5 (5)2 175 = 0.1429 20 0 (0)2 20 = 0.0000 61 11 (-11)2 61 = 1.9836 2 = 32.8252
Critical Region
= 5% = 0.05 df = (row 1)(column 1) df = (2 1)(5 1) = (1)(4) = 4
Critical Region
CRITICAL REGION
REJECT HO
DO NOT REJECT HO
9.488 DECISION: REJECT HO 2 = 32.8252
Ho: Favorite way to eat ice cream and gender, are independent. H1: Favorite way to eat ice cream and gender, are dependent.
Conclusion: Favorite way to eat ice cream and gender are dependent. Interpretation: This indicates that males prefer cup and other as their favorite way to eat ice cream than females as expected while females prefer cone as their favorite way to eat ice cream than males as expected.