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.
Share:
๐ฏโญ INTERACTIVE LESSON
Try the Interactive Version!
Learn step-by-step with practice exercises built right in.
๐ฒ 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=โ
๐ 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:
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 100% free. No account is needed to access the content.
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.
allย cells
โ
Expected(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.)
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 H0โ:independence at ฮฑ=0.05.
๐ก Show Solution
Organize:
Red
Blue
Total
Small
30
20
50
Large
25
40
65
Total
55
55
110
Expected counts:
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=3 and ฮฑ=0.05, find the critical value and determine the conclusion.
๐ก Show Solution
Critical value from chi-square table:
For df=3 and ฮฑ=0.05, the critical value is ฯ.
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.
Since 0.019<0.05, rejectH0โ. Significant evidence that Size and Color are associated.
0.05,3
2
โ
โ
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.