CHI-SQUARE HYPOTHESIS TEST-𝝌𝟐
Test for Independence of Association
This hypothesis test involves establishing whether or not two categorical random
variables are independent.
Example
A motor vehicle dealer wishes to find out if the size of car bought is in any way
related to the age of the buyer. From sales invoices over the past two years, a
sample of 300 buyers were classified by size of car bought and buyer’s age. The
following contingency table was constructed
Car Size Bought
Buyer’s Age
Small Medium Large
Under 30 10 22 34
30-45 24 42 48
Over 45 52 32 36
Test at 1% level of significance whether car size bought and buyer’s age are
independent. [𝝌𝟐 = 𝟏𝟑. 𝟐𝟕𝟕]
Solution
𝑯𝒐 : There is no association between age and car size
𝑯𝟏 : There is an association between age and car size
Decision Rule
Accept 𝑯𝒐 𝒊𝒇 𝝌𝟐 ≤ 𝟏𝟑. 𝟐𝟕𝟕
Reject 𝑯𝒐 𝒊𝒇 𝝌𝟐 > 𝟏𝟑. 𝟐𝟕𝟕
, 𝒓𝒐𝒘 𝒕𝒐𝒕𝒂𝒍 × 𝒄𝒐𝒍𝒖𝒎𝒏 𝒕𝒐𝒕𝒂𝒍
𝑬𝒙𝒑𝒆𝒄𝒕𝒆𝒅 𝒇𝒓𝒆𝒒𝒖𝒆𝒏𝒄𝒚 = 𝒇𝒆 =
𝒈𝒓𝒂𝒏𝒅 𝒕𝒐𝒕𝒂𝒍
Observed frequency table
Car Size Bought
Buyer’s Age
Small Medium Large Row Total
Under 30 10 22 34 66
30-45 24 42 48 114
Over 45 52 32 36 120
Column Total 86 96 118 300
Expected frequency table
Car Size Bought
Buyer’s Age
Small Medium Large Row Total
Under 30 86 × 66 96 × 66 118 × 66 66
300 300 300
= 𝟏𝟖. 𝟗𝟐 = 𝟐𝟏. 𝟏𝟐 = 𝟐𝟓. 𝟗𝟔
30-45 86 × 114 96 × 114 118 × 114 114
300 300 300
= 𝟑𝟐. 𝟔𝟖 = 𝟑𝟔. 𝟒𝟖 = 𝟒𝟒. 𝟖𝟒
Over 45 86 × 120 96 × 120 118 × 120 120
300 300 300
= 𝟑𝟒. 𝟒𝟎 = 𝟑𝟖. 𝟒𝟎 = 𝟒𝟕. 𝟐𝟎
Column Total 86 96 118 300
2
(𝑓𝑜 − 𝑓𝑒 )2
𝜒𝑠𝑡𝑎𝑡 =∑
𝑓𝑒
Test for Independence of Association
This hypothesis test involves establishing whether or not two categorical random
variables are independent.
Example
A motor vehicle dealer wishes to find out if the size of car bought is in any way
related to the age of the buyer. From sales invoices over the past two years, a
sample of 300 buyers were classified by size of car bought and buyer’s age. The
following contingency table was constructed
Car Size Bought
Buyer’s Age
Small Medium Large
Under 30 10 22 34
30-45 24 42 48
Over 45 52 32 36
Test at 1% level of significance whether car size bought and buyer’s age are
independent. [𝝌𝟐 = 𝟏𝟑. 𝟐𝟕𝟕]
Solution
𝑯𝒐 : There is no association between age and car size
𝑯𝟏 : There is an association between age and car size
Decision Rule
Accept 𝑯𝒐 𝒊𝒇 𝝌𝟐 ≤ 𝟏𝟑. 𝟐𝟕𝟕
Reject 𝑯𝒐 𝒊𝒇 𝝌𝟐 > 𝟏𝟑. 𝟐𝟕𝟕
, 𝒓𝒐𝒘 𝒕𝒐𝒕𝒂𝒍 × 𝒄𝒐𝒍𝒖𝒎𝒏 𝒕𝒐𝒕𝒂𝒍
𝑬𝒙𝒑𝒆𝒄𝒕𝒆𝒅 𝒇𝒓𝒆𝒒𝒖𝒆𝒏𝒄𝒚 = 𝒇𝒆 =
𝒈𝒓𝒂𝒏𝒅 𝒕𝒐𝒕𝒂𝒍
Observed frequency table
Car Size Bought
Buyer’s Age
Small Medium Large Row Total
Under 30 10 22 34 66
30-45 24 42 48 114
Over 45 52 32 36 120
Column Total 86 96 118 300
Expected frequency table
Car Size Bought
Buyer’s Age
Small Medium Large Row Total
Under 30 86 × 66 96 × 66 118 × 66 66
300 300 300
= 𝟏𝟖. 𝟗𝟐 = 𝟐𝟏. 𝟏𝟐 = 𝟐𝟓. 𝟗𝟔
30-45 86 × 114 96 × 114 118 × 114 114
300 300 300
= 𝟑𝟐. 𝟔𝟖 = 𝟑𝟔. 𝟒𝟖 = 𝟒𝟒. 𝟖𝟒
Over 45 86 × 120 96 × 120 118 × 120 120
300 300 300
= 𝟑𝟒. 𝟒𝟎 = 𝟑𝟖. 𝟒𝟎 = 𝟒𝟕. 𝟐𝟎
Column Total 86 96 118 300
2
(𝑓𝑜 − 𝑓𝑒 )2
𝜒𝑠𝑡𝑎𝑡 =∑
𝑓𝑒