The chi-square test of independence helps you decide whether two categorical variables are independent (unrelated) or whether there’s a statistically significant association between them. You use this test when your data are frequency counts (how many observations fall into each category combination) for two categorical variables.
When to use this test
Some situations where the chi-square test of independence is appropriate:
Is a customer’s preference for a product independent of the state that the customer lives in?
Is level of education independent of opinion on a policy?
Is the number of defective products independent of the time of day they were made?
Key equations
Decision rule
If χcalculated2>χcritical2: Reject the null hypothesis H0 and conclude there is a statistically significant association between the variables.
If χcalculated2≤χcritical2: Fail to reject H0. There is not enough evidence to conclude an association exists.
Practice problem
Example:
A researcher wants to know if there is an association between a person’s age group and their preferred social media platform. They survey 300 people and obtain the following results:
Instagram
TikTok
Facebook
Total
Teens
60
40
10
110
Adults
40
30
120
190
Total
100
70
130
300
Part a.
State the hypotheses.
Solution:
(spoiler)
Null hypothesis (H0): Age group and social media preference are independent. There is no association between them.
Alternative hypothesis (Ha): Age group and social media preference are not independent. There is an association between them.
Part b.
Calculate the expected frequencies Eij.
Use the formula:
Eij=Grand Total(Row Totali)(Column Totalj)
Compute for each cell:
ET,IG=300(110)(100)=30011,000≈36.67
ET,TT=300(110)(70)=3007,700≈25.67
ET,FB=300(110)(130)=30014,300≈47.67
EA,IG=300(190)(100)=30019,000≈63.33
EA,TT=300(190)(70)=30013,300≈44.33
EA,FB=300(190)(130)=30024,700≈82.33
Solution:
(spoiler)
Instagram
TikTok
Facebook
Teens
≈36.67
≈25.67
≈47.67
Adults
≈63.33
≈44.33
≈82.33
All expected frequencies are greater than 5, so we can proceed with the test.
The chi-square test of independence helps you decide whether two categorical variables are independent (unrelated) or whether there’s a statistically significant association between them. You use this test when your data are frequency counts (how many observations fall into each category combination) for two categorical variables.
When to use this test
Some situations where the chi-square test of independence is appropriate:
Is a customer’s preference for a product independent of the state that the customer lives in?
Is level of education independent of opinion on a policy?
Is the number of defective products independent of the time of day they were made?
Key equations
Decision rule
If χcalculated2>χcritical2: Reject the null hypothesis H0 and conclude there is a statistically significant association between the variables.
If χcalculated2≤χcritical2: Fail to reject H0. There is not enough evidence to conclude an association exists.
Practice problem
Example:
A researcher wants to know if there is an association between a person’s age group and their preferred social media platform. They survey 300 people and obtain the following results:
Instagram
TikTok
Facebook
Total
Teens
60
40
10
110
Adults
40
30
120
190
Total
100
70
130
300
Part a.
State the hypotheses.
Solution:
(spoiler)
Null hypothesis (H0): Age group and social media preference are independent. There is no association between them.
Alternative hypothesis (Ha): Age group and social media preference are not independent. There is an association between them.
Part b.
Calculate the expected frequencies Eij.
Use the formula:
Eij=Grand Total(Row Totali)(Column Totalj)
Compute for each cell:
ET,IG=300(110)(100)=30011,000≈36.67
ET,TT=300(110)(70)=3007,700≈25.67
ET,FB=300(110)(130)=30014,300≈47.67
EA,IG=300(190)(100)=30019,000≈63.33
EA,TT=300(190)(70)=30013,300≈44.33
EA,FB=300(190)(130)=30024,700≈82.33
Solution:
(spoiler)
Instagram
TikTok
Facebook
Teens
≈36.67
≈25.67
≈47.67
Adults
≈63.33
≈44.33
≈82.33
All expected frequencies are greater than 5, so we can proceed with the test.