Chi-Square Tests for Independence and Homogeneity | Study Mondo
Chi-Square Tests for Independence and Homogeneity
Chi-square test for independence (one sample, two categorical variables) and for homogeneity (multiple independent samples), including expected counts, degrees of freedom, and conditions.
🔲 Chi-Square Tests for Independence and Homogeneity
Chi-square tests are used to analyze the relationship between two categorical variables. Two common scenarios are tested: independence (one sample, two categorical variables) and homogeneity (multiple independent samples, one categorical variable each).
The Chi-Square Test Statistic
Both tests use the same test statistic:
χ2=∑all cellsExpected(Observed−Expected)2
where:
Observed = actual count in each cell of the contingency table
Expected = count predicted under the null hypothesis
The test statistic follows a chi-square distribution with degrees of freedom depending on the context.
Test for Independence
Purpose: Test whether two categorical variables in a single population are independent.
Hypotheses:
H0: The two variables are independent (no association)
Ha: The two variables are associated (not independent)
Expected Cell Counts (under H0 of independence):Eij=Grand total(Row totali)×(Column totalj)
Degrees of Freedom:df=(r−1)(c−1)
where r = number of rows, c = number of columns in the contingency table.
Test for Homogeneity
Purpose: Test whether the distribution of a categorical variable is the same across multiple independent groups (samples).
Hypotheses:
H0: The distribution of the variable is the same in all groups (homogeneous)
Ha: The distribution of the variable differs across groups (not homogeneous)
Expected Cell Counts (under H0 of homogeneity):Eij=Grand total(Row totali)×(Column totalj)
Note: Formula is identical to the independence test, but interpretation differs.
Degrees of Freedom:df=(r−1)(c−1)
where r = number of categories in the variable, c = number of groups/samples.
Conditions for Chi-Square Tests
Condition
Requirement
Random sampling
Data must be from random samples.
Independence
Observations are independent within each cell.
Large Counts
All expected cell counts must be ≥5 (some allow ≥1 if no more than 20% of cells are <5).
Sample Size
Usually n≥20 to ensure reliable results.
Worked Example 1: Test for Independence
A study of 200 college students asks about Gender (M/F) and Exercise Habit (Regular/Irregular). The data:
Regular
Irregular
Total
Male
40
30
70
Female
60
70
130
Total
100
100
200
Test H0: Gender and Exercise are independent, at α=0.05.
p-value:
For χ2=2.198 with df=1, P(χ2>2.198)≈0.138.
Since p-value≈0.138>0.05, fail to rejectH0. No significant evidence that gender and exercise are associated.
Worked Example 2: Test for Homogeneity
Compare the distribution of Political Party (Democrat/Republican/Independent) across three Age Groups (18–30, 31–50, 50+). Sample of 600 people:
Party
18–30
31–50
50+
Total
Dem.
80
90
70
240
Rep.
50
100
110
260
Ind.
20
30
30
80
Total
150
220
230
600
Test H0: Political party distribution is the same across age groups, at α=0.05.
Calculate expected counts (sample):
ED,1=600240×150=60
ED,2=600240×220=
... (all ≥5) ✓
Calculate χ2 (simplified; full calculation omitted):χ2≈15.38
Degrees of freedom:df=(3−1)(3−1)=4
p-value:
For χ2≈15.38 with df=4, P(χ2>15.38)≈0.0036.
Since p-value≈0.0036<0.05, rejectH0. Significant evidence that political party distribution differs across age groups.
Common Pitfalls
⚠️ Using Observed Instead of Expected Counts: The chi-square statistic compares observed counts to expected counts under H0. Always compute expected counts carefully; a mistake here invalidates the entire test.
⚠️ Ignoring the Large Counts Condition: If expected counts are too small (typically <5), the chi-square distribution is not a good approximation. Combine categories or use Fisher's exact test if appropriate.
⚠️ Confusing Independence and Homogeneity: Both use the same χ2 statistic and formula, but test different hypotheses. Independence: one sample, two variables. Homogeneity: multiple samples, one variable.
Calculator Tip
💡 TI-84 / TI-Nspire: Use χ2 Goodness-of-Fit or χ2 Test. Enter the observed counts in a matrix, then calculate. The calculator computes expected counts, χ2, df, and p-value automatically. (Some calculators use "Chi2 Test" for homogeneity/independence and "Chi2 GOF" for goodness-of-fit.)
📚 Practice Problems
1Problem 1easy
❓ Question:
In a 2×3 contingency table with row totals (100, 150) and column totals (80, 110, 60), find the expected count for the cell in row 1, column 2.
💡 Show Solution
Grand total:Grand Total=100+150=250
Expected count:E1,2=Grand Total
Answer: Expected count = 44.
2Problem 2medium
❓ Question:
A contingency table for Color (Red/Blue) and Size (Small/Large) has observed counts: (30, 20, 25, 40). Row totals: (50, 65), Column totals: (55, 55). Compute χ2 and determine whether to reject H at .
3Problem 3hard
❓ Question:
A test of homogeneity compares Preference (Yes/No) across four Groups (A, B, C, D). The observed χ2=8.45. With df= and , find the critical value and determine the conclusion.
Explain using:
⚠️ Common Mistakes: Chi-Square Tests for Independence and Homogeneity
What is Chi-Square Tests for Independence and Homogeneity?▾
Chi-square test for independence (one sample, two categorical variables) and for homogeneity (multiple independent samples), including expected counts, degrees of freedom, and conditions.
How can I study Chi-Square Tests for Independence and Homogeneity effectively?▾
Start by reading the study notes and working through the examples on this page. Then use the flashcards to test your recall. Practice with the 3 problems provided, checking solutions as you go. Regular review and active practice are key to retention.
Is this Chi-Square Tests for Independence and Homogeneity study guide free?▾
Yes — all study notes, flashcards, and practice problems for Chi-Square Tests for Independence and Homogeneity on Study Mondo are free to access. No account is needed.
What course covers Chi-Square Tests for Independence and Homogeneity?▾
Chi-Square Tests for Independence and Homogeneity is part of the AP Statistics course on Study Mondo, specifically in the Unit 8: Inference for Categorical Data — Chi-Square section. You can explore the full course for more related topics and practice resources.
Are there practice problems for Chi-Square Tests for Independence and Homogeneity?▾
Yes, this page includes 3 practice problems with detailed solutions. Each problem includes a step-by-step explanation to help you understand the approach.
35
65
65
25
+
6525+
6525=
0.714+
0.714+
0.385+
0.385=
2.198
88
(Row 1 Total)×(Column 2 Total)
=
250100×110=
25011000=
44
0
:
independence
α=0.05
💡 Show Solution
Organize:
Red
Blue
Total
Small
30
20
50
Large
25
40
65
Total
55
55
110
Expected counts:
ES,R=11050×55=
ES,B=11050×55=
EL,R=11065×55=
EL,B=11065×55=
All ≥5 ✓
Chi-square:χ2=25
Degrees of freedom:df=(2−1)(2−1)=1
p-value:P(χ2>5.46∣df=1)≈0.019
Since 0.019<0.05, rejectH0. Significant evidence that Size and Color are associated.
3
α=0.05
💡 Show Solution
Critical value from chi-square table:
For df=3 and α=0.05, the critical value is χ0.05,32≈7.815.
Decision:
Since the observed χ2=8.45>7.815, we rejectH0.
Alternatively, using p-value:P(χ2>8.45∣df=3)≈0.038
Since p-value≈0.038<0.05, we rejectH0.
Conclusion: There is significant evidence that the distribution of preferences (Yes/No) differs across the four groups. At least one group has a different preference distribution than the others.