AP Statistics Unit 8 Inference for Categorical Data

Topic 8.6: Carrying Out a Chi-Square Test for Homogeneity or Independence

Computing the Chi-Square Statistic, Finding the p-value, Interpreting Results, and Completing the Test
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:

Key Vocabulary

Chi-Square StatisticThe value found by adding all cell contributions, measuring how far observed counts are from expected counts.
ContributionA single cell's value in the chi-square sum, calculated as (observed - expected)2 / expected.
Degrees of FreedomFor a chi-square test for homogeneity or independence, df = (rows - 1)(columns - 1), not counting totals.
p-valueThe probability, assuming the null hypothesis is true, of getting a chi-square statistic at least as large as the one observed.
Table CThe AP exam chi-square critical value table used to bracket a p-value between two tail probabilities.
Chi-Squared CDFA calculator command used to find the exact right-tail p-value from a chi-square distribution.
Significance LevelThe cutoff alpha used to decide whether a p-value is small enough to reject the null hypothesis.
Reject H0The decision made when the p-value is less than or equal to alpha.
Fail to Reject H0The decision made when the p-value is greater than alpha.
Convincing Statistical EvidenceLanguage used in conclusions after rejecting the null hypothesis in favor of the alternative.
Follow-Up AnalysisA look at the largest contributions to the chi-square statistic to see which cells help explain the result.
Matrix BOn a TI calculator, the matrix where expected counts are stored after running a chi-square test.

Video 1: Calculating the Test Statistic and p-Value

[0:00 – 9:55]
1. [0:20] The first question in the video asks how to calculate an appropriate test for a chi-square test for homogeneity or independence.
2. [0:25] The second question asks how to calculate a for a chi-square test for homogeneity or independence.
Example 1 — Where Do You Go To School? [0:38 – 1:04] A random sample of parents with school-aged children was taken during 2019, and a separate random sample was taken during 2020. Researchers want to determine whether the distribution of school type differed between the two years.
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
Computing the Chi-Square Statistic and p-value [1:39 – 6:13]
  1. Use expected count = (row total)(column total) / table total.
  2. Calculate each cell contribution with (observed - expected)2 / expected and add them to get χ2.
  3. Find degrees of freedom with (rows - 1)(columns - 1), excluding totals.
  4. Use Table C for a p-value interval, or use chi-squared CDF for the exact p-value.
3. [2:24] The six numbers added together in the school example are called the contributions to the chi-square .
4. [3:02] Degrees of freedom are calculated by multiplying rows minus 1 by columns minus .
5. [3:11] When counting rows and columns for degrees of freedom, do not include the total row or the total .
6. [3:31] For the school table, the degrees of freedom are .
7. [5:35] Using Table C, the school example p-value is between 0.05 and .
8. [5:48] To find the exact p-value on a calculator, use chi-squared from the distribution menu.
9. [6:13] Technology gives the school example p-value as about .
Example 2 — Are You Working? [6:32 – 6:48] A random sample of 2,000 adults provided data on education level and employment status. Researchers want to determine whether the two categorical variables are associated.
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
10. [7:35] For the employment example, the chi-square statistic is .
11. [8:20] Using Table C, the employment example p-value is between 0.0005 and .
12. [8:47] Technology gives the employment example p-value as about .

Video 2: Interpreting the p-Value and Stating a Conclusion

[0:00 – 9:39]
School Example Review [1:13 – 1:53] For the school-type example, the earlier work gave H0: no difference in the distribution of school types from 2019 to 2020, Ha: there is a difference, χ2 = 5.55, and p-value = 0.062.
Templates for Interpretation and Conclusion [2:10 – 4:25]
  1. Interpretation template: Assuming H0 is true, there is a p-value probability of getting a chi-square statistic of the observed value or greater by chance alone in the random sample or random assignment.
  2. If p-value ≤ alpha, reject H0 and say there is convincing statistical evidence for Ha in context.
  3. If p-value > alpha, fail to reject H0 and say there is not convincing statistical evidence for Ha in context.
13. [2:27] The p-value interpretation template begins by assuming the hypothesis is true.
14. [4:34] Because no significance level was given in the school example, the video uses α = .
15. [5:01] Because 0.062 is greater than 0.05, we the null hypothesis for the school example.
Employment Example Review [5:29 – 6:46] For the employment example, H0 says there is no association between education level and employment status, Ha says there is an association, and the p-value is 0.0008 at a significance level of 0.01.
16. [6:11] The employment interpretation starts by assuming there is no between education level and employment status for all adults.
17. [6:46] Because 0.0008 is less than or equal to 0.01, we the null hypothesis.
Follow-Up Analysis [7:13 – 8:08] When a chi-square result is significant, look at the largest contributions to see which cell or cells help explain the result. In the employment example, the most noticeable contribution comes from the unemployed adults with no high school diploma.
18. [7:47] The largest contribution to the chi-square statistic in the employment example is .
19. [8:08] That contribution is large because the observed count of unemployed adults with no high school diploma is much higher than .

Video 3: Performing a Complete Chi-Square Test

[0:00 – 7:23]
AP Exam Example — 2017 #5 [0:26 – 1:48] A random sample of 207 men and women currently being treated for schizophrenia was summarized in a two-way table by age group at diagnosis and gender. The question asks whether there is convincing statistical evidence of an association between the two categorical variables.
20. [1:07] The phrase "convincing statistical evidence" signals that the problem calls for a full significance .
21. [1:39] Because the question is about association between two categorical variables in one sample, the correct procedure is a chi-square test for .
Checklist for a Complete Chi-Square Test [1:48 – 6:27]
  1. State H0 and Ha in context.
  2. If alpha is not given, use 0.05.
  3. Identify the procedure and verify the conditions.
  4. Calculate or report the chi-square statistic, degrees of freedom, and p-value.
  5. Make a decision and conclusion in context.
22. [2:18] When no significance level is stated, the video uses α = .
Summary Item Value
Sample Size 207
Chi-Square Statistic 10.884
Degrees of Freedom 3
p-value 0.012
23. [3:58] For the schizophrenia example, the chi-square statistic is .
24. [4:06] The degrees of freedom for the schizophrenia example are .
25. [6:04] Because the p-value of 0.012 is less than 0.05, we H0.

Key Takeaways

[Summary]
  1. Calculate the chi-square statistic by adding the cell contributions (observed - expected)2 / expected.
  2. Use df = (rows - 1)(columns - 1), and do not count total rows or total columns.
  3. The p-value is the right-tail probability of getting the observed chi-square statistic or larger if H0 is true.
  4. Use Table C to bracket the p-value, or use chi-squared CDF or a calculator chi-square test for the exact p-value.
  5. If p-value ≤ alpha, reject H0; if p-value > alpha, fail to reject H0.
  6. A complete chi-square test includes hypotheses, significance level, procedure, conditions, test statistic, p-value, and conclusion.

Reflection Questions

[AI-Graded]
R1. Explain how to calculate the chi-square test statistic and p-value for a chi-square test for homogeneity or independence. Include observed and expected counts, contributions, the degrees of freedom formula, not counting totals in the degrees of freedom, using Table C or chi-squared CDF, and the school example values χ2 = 5.55, df = 2, and p-value = 0.062.
R2. Explain how to interpret a p-value and state a conclusion for a chi-square test for homogeneity or independence. Include assuming H0 is true, chance alone, comparing the p-value to alpha, fail to reject versus reject, the school example at α = 0.05, the employment example at α = 0.01, and the idea of follow-up analysis using the largest contribution.

Exit Ticket

Use the schizophrenia age-group and gender example to describe a complete chi-square test for independence.

Class Responses (Esc to close)

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