AP Statistics Unit 8 Inference for Categorical Data

Topic 8.1: Introducing Statistics: Are My Results Unexpected?

Expected Counts, Building the Chi-Square Statistic, and Using Simulation to Judge Surprising Results
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

Observed CountsThe actual frequencies recorded in each category from the sample.
Expected CountsThe frequencies we would predict in each category if the null model is true.
One-Way TableA table that summarizes counts for one categorical variable across several categories.
Random VariationNatural sample-to-sample differences that occur by chance even when the model is correct.
Chi-Square StatisticA measure of overall discrepancy found by adding (Observed minus Expected) squared divided by Expected for all categories.
Good FitA description of data that match the expected counts closely enough to be believable under the model.
SimulationGenerating many random samples under the null model to see what kinds of results are typical.
Sampling DistributionThe distribution of a statistic, such as chi-square, from many repeated random samples.
P-valueThe probability, assuming the model is true, of getting a result at least as extreme as the observed one.
Weighted DieA die whose outcomes are not all equally likely.

Video 1: Introducing Significance for Categorical Counts

[0:15 – 7:04]
1. [0:15] This lesson introduces significance testing for the distribution of proportions for one variable.
2. [0:32] We want to know whether observed counts are consistent with expected counts due to random .
3. [0:41] Unit 8 goes beyond success-failure data to categorical variables with more than two .
Context — Fair Die or Weighted Die? [1:10 – 1:39] While playing a role-playing game, you notice a 10-sided die has been rolling high numbers for a while. You roll the die 100 times and record the results to decide whether the die could be weighted.
Result 1 2 3 4 5 6 7 8 9 10
Observed 7 11 7 11 9 8 12 10 13 12
4. [1:10] For a fair 10-sided die, each outcome should have probability .
5. [1:53] In 100 rolls, the expected count for each result is .
6. [1:53] If the die is fair, the 10 categories should be represented .
7. [2:23] When we add all the values in the Obs − Exp row, the total is .
8. [2:23] That total is not a useful overall measure because positive and negative differences each other out.
9. [2:55] Using absolute values gives a total of , but that total still depends heavily on the sample .
10. [3:15] Squaring the differences keeps all contributions positive and gives more weight to differences.
11. [3:15] For these die results, the sum of the squared differences is .
Building the Chi-Square Statistic [3:47 – 4:06]
  1. Start with each category's discrepancy: Observed minus Expected.
  2. Square each difference so every contribution is positive.
  3. Divide each squared difference by the expected count to make the discrepancy relative.
  4. Add the ratios: χ2 = ∑ ((Obs − Exp)2 / Exp).
12. [3:47] To make each contribution relative to what was expected, divide by the count.
13. [4:06] The final sum of these ratios is called the statistic.
14. [4:06] For the die data in the lesson, the chi-square statistic is .
15. [4:19] To judge whether 4.2 is surprising, the applet generates many random samples assuming the die is .
Simulation Logic [4:19 – 6:45]
  1. Assume the null model is true: the 10-sided die is fair.
  2. Generate many random samples of 100 rolls from that fair die model.
  3. Compute a chi-square statistic for each simulated sample.
  4. Estimate the P-value with the proportion of simulated chi-square values at least as large as the observed one.
16. [4:34] The dotplot of simulated chi-square values builds a sampling .
17. [6:45] We estimate the P-value by finding the proportion of simulated chi-square values than or equal to 4.2.
18. [6:45] The applet reported 932/1023, or about .
19. [6:45] A chi-square value of 4.2 is not very if the die is fair.
20. [6:45] The simulation evidence suggests the die is probably weighted.
21. [7:04] These results are a good to the expected counts from a fair die.

Key Takeaways

[Summary]
  1. Expected counts come from the model being tested, such as 10 expected rolls in each category for a fair 10-sided die.
  2. Raw observed-minus-expected differences are not enough because they cancel when added.
  3. The chi-square statistic adds relative squared discrepancies to summarize how far observed counts are from expected counts.
  4. Simulation shows what chi-square values are typical if the model is true.
  5. A large P-value means the data are not unusual under the model, so random variation is a reasonable explanation.

Reflection Questions

[AI-Graded]
R1. Explain how the chi-square statistic is built for the 10-sided die example. Include the expected counts for a fair die, why adding Obs − Exp is not enough, why the differences are squared and divided by expected count, the value χ2 = 4.2, and what a larger chi-square value would mean.
R2. Explain how the simulation is used to decide whether the die results are surprising. Describe the fair-die model, what the sampling distribution represents, how the P-value is estimated, the approximate P-value, and the conclusion about whether the die seems weighted.

Exit Ticket

A gamer rolls a 10-sided die 100 times and gets frequencies 7, 11, 7, 11, 9, 8, 12, 10, 13, and 12 for results 1 through 10. Assume a fair die has probability 1/10 for each result, and a simulation shows that χ2 values of 4.2 or greater occurred in 932 out of 1023 simulated samples.

Class Responses (Esc to close)

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