AP Statistics Unit 8 Inference for Categorical Data

Topic 8.5: Setting Up a Chi-Square Test for Homogeneity or Independence

Choosing the Correct Chi-Square Procedure, Writing Hypotheses, and Checking Conditions
Video Follow-Along Worksheet
↻ Already did this one? It stays open even after it’s checked off — just change any answer and click ✓ Check Answers again (no need to Reset). ✨ Grade with AI only ever raises your grade. Make sure you’re signed in so your changes save.
Learning Objectives: Essential Knowledge:
🖩 Practice on the TI-84 →

Key Vocabulary

Chi-Square Test for HomogeneityA test used to compare the distribution of one categorical variable across multiple populations or treatments.
Chi-Square Test for IndependenceA test used to decide whether two categorical variables are associated in one population.
DistributionHow the proportions or counts for a categorical variable are spread across its categories.
AssociationA relationship between two categorical variables.
Null HypothesisThe claim of no difference, no association, or independence that is tested with the data.
Alternative HypothesisThe claim that there is a difference in distributions or an association between variables.
Independent Random SamplesSeparate random samples taken from different populations or groups.
Single Random SampleOne random sample from one population with both variables measured on each individual.
10% ConditionWhen sampling without replacement, the sample size must be less than or equal to 10% of the population.
Expected CountThe count predicted for a cell if the null model is true.
Observed CountThe actual count recorded in the table.
Many-SidedA description of the alternative for homogeneity because several category proportions may differ.

Video 1: Choosing the Test and Writing Hypotheses

[0:00 – 8:00]
1. [0:19] The first lesson question asks how to identify the appropriate significance test procedure for data in a table.
2. [0:41] The correct chi-square test depends on how the data are .
3. [0:58] If the goal is to compare distributions of one categorical variable for multiple populations, use a chi-square test for .
4. [1:06] For a homogeneity test, the data come from independent random from each population.
5. [1:31] If one single random sample is taken and two categorical variables are measured on each individual, use a chi-square test for .
Decision Rule [0:58 – 1:46]
  1. Compare distributions across multiple populations or treatments: chi-square test for homogeneity.
  2. Look for association between two categorical variables in one population: chi-square test for independence.
  3. The two-way table alone is not enough; the study design tells you which test to use.
Example 1 — Where Do You Go To School? [2:18 – 2:51] A random sample of parents with school-aged children was taken during 2019. A separate random sample of parents with school-aged children was taken in 2020. Parents were asked what type of school their children attended.
School Type 2019 Sample 2020 Sample
Public 266 163
Private/Parochial/Charter 16 21
Home 38 30
6. [2:51] In the school example, the goal is to compare the of school type for the two years.
7. [3:06] Because there are two independent random samples from two years, the correct procedure is a chi-square test for .
8. [3:26] The null hypothesis for the school example says there is no in the distribution of school types from 2019 to 2020.
9. [4:08] The alternative hypothesis says there is a in the distribution of school types from 2019 to 2020.
10. [4:34] Because several proportions could be higher or lower, this alternative is described as -sided.
Hypotheses for Homogeneity [3:18 – 4:34]
  1. Use words, not a numerical parameter.
  2. H0: There is no difference in the distribution across populations or treatments.
  3. Ha: There is a difference in the distribution across populations or treatments.
Example 2 — Are You Working? [4:43 – 5:03] A random sample of 2,000 adults revealed the following data about education level and employment status. Researchers want to determine if the variables are associated.
Employment Status No HS Diploma HS Diploma
No College
HS Diploma
Some College
Employed 206 548 1186
Unemployed 14 22 24
11. [5:03] The employment example asks whether education level and employment status are .
12. [5:15] Because the data came from one single random sample, the correct procedure is a chi-square test for .
13. [5:37] The null hypothesis says there is no between education level and employment status for all adults.
14. [5:51] Another acceptable null statement is that the two variables are for all adults.
15. [6:22] The alternative hypothesis says there is an between education level and employment status for all adults.
Hypotheses for Independence [5:25 – 6:38]
  1. H0: There is no association between the variables, or the variables are independent.
  2. Ha: There is an association between the variables, or the variables are not independent.
  3. No mean or proportion parameter is defined in the hypotheses.

Video 2: Verifying the Conditions

[0:00 – 6:58]
16. [0:20] The question for this video is how to verify the for performing a chi-square test for homogeneity or independence.
17. [1:59] In general, you should check independence in the data-collection method and whether the sampling distribution has the correct .
Conditions for Chi-Square Tests [2:14 – 3:02]
  1. For homogeneity, use a stratified random sample or randomized experiment. For independence, use a single random sample.
  2. If sampling without replacement, the sample size must be less than or equal to 10% of the population.
  3. All expected counts must be greater than 5.
18. [2:24] For a homogeneity test, the data should come from a stratified random sample or a randomized .
19. [2:37] For an independence test, the data should come from a single random .
20. [2:52] When sampling without replacement, the sample size must be less than or equal to % of the population size.
21. [3:02] To justify the chi-square shape, all expected counts should be greater than .
22. [3:10] Be careful to check the expected counts, not the counts.
Checking Conditions — School Example [3:15 – 4:33] The school table below shows observed counts with expected counts in blue parentheses. The hypotheses and test type were already identified in the previous video.
School Type 2019 Sample 2020 Sample Row Total
Public 266
(257.1)
163
(171.9)
429
Private/Parochial/Charter 16
(22.2)
21
(14.8)
37
Home 38
(40.7)
30
(27.3)
68
Column Total 320 214 534
23. [3:27] In the school example, the first condition is met because there are two independent random .
24. [4:25] The smallest expected count in the school example is 14.8, which is greater than .
Checking Conditions — Employment Example [4:42 – 6:06] The employment table also shows observed counts with expected counts in blue parentheses while the conditions are checked.
Employment Status No HS Diploma HS Diploma
No College
HS Diploma
Some College
Row Total
Employed 206
(213.4)
548
(552.9)
1186
(1173.7)
1940
Unemployed 14
(6.6)
22
(17.1)
24
(36.3)
60
Column Total 220 570 1210 2000
25. [5:28] In the employment example, the first condition is met because the 2,000 adults were randomly .

Key Takeaways

[Summary]
  1. Choose homogeneity when comparing distributions across multiple populations or treatments, and choose independence when studying association between two categorical variables in one sample.
  2. For homogeneity, H0 says no difference in distributions and Ha says there is a difference.
  3. For independence, H0 says no association or independent, and Ha says association or not independent.
  4. Chi-square hypotheses are written in words, not with a numerical parameter.
  5. Check the three conditions before carrying out the test: correct random-sampling or experimental design, the 10% condition, and all expected counts greater than 5.

Reflection Questions

[AI-Graded]
R1. Explain how you decide whether a two-way table calls for a chi-square test for homogeneity or a chi-square test for independence. Include comparing distributions across multiple populations or treatments, independent random samples or a randomized experiment, one single random sample, association between two categorical variables, the school example as homogeneity, and the employment example as independence.
R2. Explain how to write null and alternative hypotheses and verify the conditions for these chi-square tests. Include no difference in distributions versus difference for homogeneity, no association or independent versus association or not independent for independence, the fact that no parameter needs to be defined, the 10% condition, and the rule that all expected counts must be greater than 5.

Exit Ticket

Use the two lesson contexts to set up chi-square inference.

Class Responses (Esc to close)

Click a "Class" button next to a question to see responses.